Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Talkback: prevent to say activity label (applcation name by default)

I disabled accesibility features for all of my fragments' and Activity views. But it keeps to say activity label (it is app name by default). As I realized it does after every fragment transaction (but i'm not sure). I am going to next fragment and it is saying application name. 1. I've tried to set empty Activity label in AndroidManifest, but if it is empty, android anyway uses app name. 2. I've tried to override Activity method dispatchPopulateAccessibilityEvent:

override fun dispatchPopulateAccessibilityEvent(event: AccessibilityEvent?): Boolean {
        return false
}

And it didn't help too. I've tried to return both "false" and "true". It doesn't affect the problem. 3. I've tried to set importantForAccesibility property of Activity view programmatically in onCreate method:

ViewCompat.setImportantForAccessibility(window.decorView,
ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO)

Obviously, it doesn't solve the problem too.

Explanation of why I need to disable Talkback for my application: i'm making app with voice control. And so i'm using text synthesizing, and text synthesizing can't work because Talkback stops my TTS.

like image 903
Kirill Avatar asked Jan 20 '26 06:01

Kirill


1 Answers

I know it's been a long time.. I had the same problem recently and I wasted a lot of time too. I tried to set the title in the activity, with an empty string resource (with or without a whitespace on it), but then it says the application name instead of the activity name. Then I realize that it works if you set the title in the activity with a Charsequence with a whitespace:

setTitle(" ")
like image 110
Valenji Avatar answered Jan 22 '26 18:01

Valenji



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!