2

I'd like to know what is the way to show Text-to-speech settings page in Honeycomb.

In previous Android versions using action com.android.settings.TTS_SETTINGS worked. Now it gives a class cast exception.

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

06-06 06:59:33.556: ERROR/AndroidRuntime(476): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.android.settings/com.android.settings.TextToSpeechSettings}: java.lang.ClassCastException: com.android.settings.TextToSpeechSettings cannot be cast to android.app.Activity
Community
  • 1
  • 1
Jonas
  • 2,096
  • 20
  • 17
  • using com.android.settings.VOICE_INPUT_OUTPUT_SETTINGS works by opening Language and input. But is there a way to open text-to-speech settings directly? – Jonas Sep 21 '11 at 12:49

1 Answers1

1

I spent a few days trying to figure it out by analyzing the Android Settings source code on Github (at a point in the history estimated to be Honeycomb) and I just got it working a few minutes ago!

Intent intent = new Intent(android.provider.Settings.ACTION_SETTINGS);
intent.putExtra(EXTRA_SHOW_FRAGMENT, "com.android.settings.TextToSpeechSettings");
intent.putExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS, intent.getExtras());
startActivity(intent);
Pilot_51
  • 7,337
  • 3
  • 29
  • 26
  • 1
    Using KitKat, just replace the fragment extra with "com.android.settings.tts.TextToSpeechSettings" for it to work. – JM Lord Jan 04 '16 at 15:38