0

What I want is to have a listener when a certain element (like a button, an image, a view or anything else) became accessibility focused. I found stuff like mybutton.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED) but then I don't know what to do next, how to handle it. My main purpose is to make a sound when an element became focused instead of reading his accessibility name. Any suggestion?

Poli97
  • 305
  • 4
  • 18
  • why would you want to make a sound instead of reading it's accessibility name? I can't understand the use case for that, is it a game or something? If you want to play a sound instead of the accessible name, don't add the accessible name in the first place? – GrahamTheDev Jan 08 '20 at 23:29
  • I have to make a grammatical exercise for visually impared child in which i have some cards with animals and I have to reproduce the sound of the animal when it become focused. Ok not to add the accessible name in the first place but than how to reproduce a sound when the element became focused? – Poli97 Jan 09 '20 at 14:09

1 Answers1

0

Im not much of an Android developer, but i think the event you are using is sending information to the screen reader. You would need the opposite of that.

I think the answer to this question could help you Google talkback API to get current focus item in android

Best of luck, sounds like a cool app for visually impaired children

Witten
  • 23
  • 3