I have a viewpager that contains multiple fragments. When the activity is launched, I can read the content of fragment with a click. But when swipe, talkback only announce the pager position without reading the content. Is there a way to announce the page number then read it's content?
Asked
Active
Viewed 1,919 times
1 Answers
-1
You can set contentsDescription to Fragment's child view.
For example, if you have a TextView and it has contents that you want to speak by talk back, you can do this:
textView.setContentDescription("Hello world");
Or, you can add "android:contentDescription" to xml.
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="Hello world"
</TextView>

Stanley Ko
- 3,383
- 3
- 34
- 60