Andrew Yunoshev
Andrew Yunoshev

Reputation: 21

How show "Voice Input and Output" settings page from application?

To help the user choose the settings I want from my application to open the Voice Input and Output settings page. I can just open the settings (Settings.ACTION_SETTINGS), I can open the various pages out there (Settings.ACTION_XXXX_SETTINGS) - but it can not find how to do it for Voice Input and Output page.

Any idea?

P.S. I try check source Settings.apk, but no one not using VoiceInputOutputSettings.java

Upvotes: 2

Views: 4503

Answers (3)

mmmx
mmmx

Reputation: 21

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?

Upvotes: 2

Pargat
Pargat

Reputation: 769

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);

Upvotes: 1

shihpeng
shihpeng

Reputation: 5381

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.

Upvotes: 2

Related Questions