Show “Text-to-speech settings” page from application in Honeycomb?
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.a开发者_JAVA百科ndroid.settings.TextToSpeechSettings cannot be cast to android.app.Activity
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);
精彩评论