3

I know I can query the AccesibilityManager to determine if TalkBack has been enabled. Is there a way to detect when TalkBack is enabled using a broadcast receiver? I would prefer this solution as it can be enabled at anytime.

Shailen Tuli
  • 13,815
  • 5
  • 40
  • 51
Alan
  • 9,331
  • 14
  • 52
  • 97

1 Answers1

2

You can try to set an AccessibilityStateChangeListener which will trigger a callback when the ... state of accessibility changes.

The docs say this is triggered when the AccessibilityManager#isEnabled() state changes, but I believe that will return true if there is at least one accessibility service enabled (meaning if you have two services enabled and turn TalkBack off, it'll still say accessibility is enabled).

TalkBack is a single implementation of spoken feedback accessibility services on Android - even if it did broadcast an intent, I wouldn't rely on it solely, but as you say, check the state onStart/onResume().

ataulm
  • 15,195
  • 7
  • 50
  • 92