如何知道Android的对讲系统活跃? [英] How to know if Android TalkBack is active?

查看:160
本文介绍了如何知道Android的对讲系统活跃?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发使用话语提示通过它来指导人们的应用程序。然而,在这些情况下,我想拥有的应用程序的布局有些微妙的差异使导航更容易,也有额外的语音输出(与TextToSpeech),以帮助指导用户。

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 application so navigation is easier and also have extra voice outputs (with TextToSpeech) to help guide the user.

我的问题是,我只希望这些变化和额外的输出,如果用户有话语提示活跃。

My problem is that I only want those changes and extra outputs if the user has TalkBack active.

有没有办法知道它是什么?我没有找到具体的直接访问话语提示设置什么,但我希望有某种形式的访问一般手机设置,可以让我知道我需要什么的。

Is there any way to know if it is? I didn't find anything specific to access TalkBack settings directly, but I was hoping there was some form of accessing general phone settings that could let me know what I need.

问候和感谢提前。

推荐答案

举一个例子,看看 isScreenReaderActive()的<一个href="http://$c$c.google.com/p/eyes-free/source/browse/trunk/shell/src/com/google/marvin/shell/HomeLauncher.java?spec=svn623&r=623"相对=nofollow> HomeLauncher.java的眼睛:免费外壳应用程序(文件通过的组线程)。

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.

如果你真的想限制它只能对讲系统,你可以尝试检查 ResolveInfo.serviceInfo.packageName queryIntentServices每个返回的结果( )来看看它的话语提示包相匹配。

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.

这篇关于如何知道Android的对讲系统活跃?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆