Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Preventing TalkBack to read the application Name and current Orientation

Problem is I am using TTS to read a long string message when my activity is launched, but TalkBack automatically reads the application name in the middle of it and cuts the long string and is very annoying.

I would like to disable the TalkBack read the Application name every time an activity is launched. Removing its android:label attribute is not a viable solution as the application is controlled by someone else and I have no control over it.

So, Is there any API that I could call to prevent the TalkBack feature from reading the application name when an application is launched?

Any Help would be highly appreciated.

Thanks a lot in advance.

Regards, Ashok

like image 386
ASingal Avatar asked Sep 03 '14 21:09

ASingal


People also ask

What is the Android app TalkBack?

TalkBack is the Google screen reader included on Android devices. TalkBack gives you eyes-free control of your device. The setup of your device depends on the device manufacturer, Android version, and TalkBack version. These help pages apply to most devices, but you might experience some differences.

How do I turn off Accessibility on Android?

Open your Android device's Settings app . Select Accessibility. Switch Access. At the top, select the On/Off switch.

How do I give an app permanent Accessibility?

On your device, open Settings > Accessibility. Scroll until you find Accountable2You. Tap on Accountable2You. Toggle Accessibility to Off and then On again (it may show as on but still be disabled - this step will reset it).

How do I change the Accessibility focus on Android?

In Android Studio, using Java, to set the accessibility focus on a certain myview you have to do myview. sendAccessibilityEvent(AccessibilityEvent. WINDOWS_CHANGE_ACCESSIBILITY_FOCUSED) and it works fine.


2 Answers

You should add this to AndroidManifest.xml

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

Leave android:label empty if you don't want TalkBack to read activity name.

like image 99
Shilbodhi Shambharkar Avatar answered Nov 16 '22 01:11

Shilbodhi Shambharkar


A solution would be to override dispatchPopulateAccessibilityEvent() in Activity to return true. This will prevent Talkback from announcing activity label.

like image 21
Satishkumar Avatar answered Nov 16 '22 01:11

Satishkumar