My Android app contains a custom SeekBar based SeekBar , and I want to attach my text phrase to it to explain its use for accessibility.
I have successfully dealt with using View.setContentDescription(text) , and TalkBack pronounces the phrase correctly when I request focus on my slider control from Activity.onCreate .
So far so good. However, when I touch on a control that I believe sets AccessibilityFocus on my Android API 16 test device, additional words are added to the spoken phrase, that is, "... search for control." 0%. "I want to remove these additional words.
I tried to eliminate them using event.getText().clear() View.onInitializeAccessibilityEvent(event) event.getText().clear() in View.onInitializeAccessibilityEvent(event) without success. Repeating this event, LogCat reports the correct phrase in event.contentDescription and has no entries in event.text , but additional words appear both on the audio output of the device hardware and in the text debug text displayed in the menu-> Settings-> Accessibility-> TalkBack -> Settings-> Developer Settings-> Display speech output.
Please, can you suggest where additional words are added, and how to eliminate them?
Any constructive suggestions would be welcome. Thanks.
Update
I see that some kind of Explore By Touch event (initial single click) on my custom control does not go through its onInitializeAccessibilityEvent or dispatchPopulateAccessibilityEvent methods, as I intentionally call event.setContentDescription(null) . Despite this, an AccessibilityEvent is created with my custom ContentDescription control set in Activity.onCreate in the code, plus additional words that I'm trying to eliminate.
I also set the AccessibilityDelegate to my custom parent ViewGroup control to display its calls to onRequestSendAccessibilityEvent . This confirms that not a single event containing my ContentDescription passes.
This is very puzzling and happens both on the emulator and on real hardware with API 16. Any ideas?
source share