How to display Voice Recognition Settings screen programmatically

ⅰ亾dé卋堺 提交于 2020-01-05 07:16:12

问题


From within an Android app, how to show the system Voice Recognition Settings screen?

Note: there is a similar question here but it is out of date.


回答1:


Pre-Jelly Bean, the way to do this is using the intent:

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClassName("com.google.android.voicesearch", "com.google.android.voicesearch.VoiceSearchPreferences");

HOWEVER: I have not had a chance to test this on Honeycomb (API 11-13) - anyone know?

Jelly Bean, you need to change the package name:

intent.setClassName("com.google.android.googlequicksearchbox", "com.google.android.voicesearch.VoiceSearchPreferences");


来源:https://stackoverflow.com/questions/11860229/how-to-display-voice-recognition-settings-screen-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!