How to know if Android TalkBack is active?

前端 未结 8 2156
南旧
南旧 2020-12-02 15:23

I\'m developing an application that uses TalkBack to guide people through it. However, in those situations I want to have some subtile differences in the layout of the appli

8条回答
  •  無奈伤痛
    2020-12-02 16:12

    For an example, look at isScreenReaderActive() in HomeLauncher.java file in the Eyes-Free shell application (via groups thread).

    To sum up: you detect all screen readers with Intents, then query the status provider of each to see if it is active.

    If you really want to limit it to TalkBack only, you could try checking the ResolveInfo.serviceInfo.packageName for each result returned from queryIntentServices() to see if it matches the TalkBack package.

提交回复
热议问题