How show “Voice Input and Output” settings page from application?

烂漫一生 提交于 2019-12-04 16:45:11

The following is found in Android 2.3.3 source code git:

 501         <activity android:name="VoiceInputOutputSettings"
 502                 android:label="@string/voice_input_output_settings">
 503             <intent-filter>
 504                 <action android:name="android.intent.action.MAIN" />
 505                 <action android:name="com.android.settings.VOICE_INPUT_OUTPUT_SETTINGS" />
 506                 <category android:name="android.intent.category.DEFAULT" />
 507             </intent-filter>
 508         </activity>
 509 
 510         <activity android:name="TextToSpeechSettings" android:label="@string/tts_settings">
 511             <intent-filter>
 512                 <action android:name="android.intent.action.MAIN" />
 513                 <action android:name="com.android.settings.TTS_SETTINGS" />
 514                 <category android:name="android.intent.category.DEFAULT" />
 515             </intent-filter>
 516         </activity>

There may not be official constant for these two actions. But you can try "com.android.settings.VOICE_INPUT_OUTPUT_SETTINGS" and "com.android.settings.TTS_SETTINGS", it works on my Nexus S.

mmmx

This is my code working with Android 2.2

final Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(ComponentName.unflattenFromString("com.android.settings/.TextToSpeechSettings"));
intent.addCategory(Intent.CATEGORY_LAUNCHER );
startActivity(intent);

See also: how to show up the settings for text to speech in my app?

This code works well for showing voice input/output settings page. Hope this works for you.

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(new ComponentName("com.android.settings","com.android.settings.VoiceInputOutputSettings"));     
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!