你如何得到一个新开始的活动在Android TalkBack中宣布自己?

Tea*_*zel 5 android android-activity talkback

你如何得到一个新开始的活动在Android TalkBack中宣布自己?

我能找到的所有文档仅涉及视图,而不是活动,而这些视图仅在触及时宣布自己.我需要的是,在更改活动时,一些语音文本告诉用户他们在应用层次结构中的位置.现在,在每次活动更改时,TalkBack每次只会说出应用名称,这是没用的.

我已经尝试将contentDescription添加到Activities布局XML中的根布局元素,但这似乎没有任何区别.例:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:contentDescription="My new Activity"
>
Run Code Online (Sandbox Code Playgroud)

提前致谢...

kco*_*ock 7

在您android:labelActivity标签上使用该属性AndroidManifest.

  • 我想知道如何在运行时覆盖它. (4认同)
  • 在运行时,您只需在 Activity 上调用 setTitle 即可。 (2认同)