Android - Prevent TalkBack from reading application Name and current orientation

The problem is that I use TTS to read a long string message when I start my activity, but TalkBack automatically reads the application name in the middle and shortens the long line and is very annoying.

I would like to disable TalkBack in order to read the application name every time an action is run. Removing the android: label attribute is not a viable solution since the application is controlled by someone else and I do not control it.

So, is there any API I could call to prevent TalkBack functions from reading the application name when the application starts?

Any help would be greatly appreciated.

Thank you very much in advance.

Regards, Ashok

+6
source share
4 answers

The solution would be to override dispatchPupulateAccessibilityEvent () in Activity to return true. This will prevent Talkback from being tagged.

+6
source

So, is there any API I could call to prevent TalkBack functions from reading the application name when the application starts?

Not that I knew.

The problem is that I use TTS to read a long string message when I start my activity, but TalkBack automatically reads the application name in the middle and shortens the long line and is very annoying.

Then hold up your “long string message” a bit to give TalkBack time for standard announcements.

+1
source

But this line in onCreate Launcher Activity

ViewCompat.setImportantForAccessibility(getWindow().getDecorView(),ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO); it works for me.

+1
source
 <activity android:name="com.mobile.myapp.test" android:label="About" android:screenOrientation="portrait" /> 

Leave android: the shortcut is empty if you do not want TalkBack to read the name of the activity.

0
source

Source: https://habr.com/ru/post/974775/


All Articles