I have an application which uses the tts engine in Android, now as the activity starts, I want to show to the users the settings present in the phone for the tts engine in w
I have merged Bandreid's and Force's answer to support every Android Version.
Use this code:
//Open Android Text-To-Speech Settings
if (Build.VERSION.SDK_INT >= 14){
Intent intent = new Intent();
intent.setAction("com.android.settings.TTS_SETTINGS");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}else {
Intent intent = new Intent();
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setComponent(new ComponentName("com.android.settings", "com.android.settings.TextToSpeechSettings"));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
Or in one line:
//Open Android Text-To-Speech Settings
startActivity(Build.VERSION.SDK_INT >= 14 ?
new Intent().setAction("com.android.settings.TTS_SETTINGS").setFlags(Intent.FLAG_ACTIVITY_NEW_TASK) :
new Intent().addCategory(Intent.CATEGORY_LAUNCHER).setComponent(new ComponentName("com.android.settings", "com.android.settings.TextToSpeechSettings")).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
Hope my answer help!