I want Fragment
to announce itself on launch in Android Talkback. Activity
does announce itself when added 'android:label' on the activity tag in AndroidManifest file. How can I do that for Fragment
?
You can use one of the Fragment lifecycle methods to announce it yourself.
Fragments don't have an intrinsic title, and since they're basically Views + logic, it seems reasonable that the system can't predict when it would be appropriate to announce a newly added Fragment.
Something like overriding onCreateView(View view, ...)
and then calling view.announceForAccessibility("title of my fragment")
would work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With