From 58ea43acf9bccaeca8dbd12c185adabad67abf58 Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Wed, 9 Sep 2009 15:13:38 -0700 Subject: [PATCH] Fix bug 2078454 where clicking on Settings in the Home menu would take the user to Market after clicking on "Install Voice Data" in the TTS Settings page. Launching the Activity for the installation of the TTS data should be a distinct task, dissociated from the one associated with the Settings app. Also the intent ACTION_INSTALL_TTS_DATA doesn't return a result, so the activity should be started with startActivity() rather than startActivityForResult(). --- src/com/android/settings/TextToSpeechSettings.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/com/android/settings/TextToSpeechSettings.java b/src/com/android/settings/TextToSpeechSettings.java index d4ffe65a9c5..f60d0f25d5b 100644 --- a/src/com/android/settings/TextToSpeechSettings.java +++ b/src/com/android/settings/TextToSpeechSettings.java @@ -90,11 +90,6 @@ public class TextToSpeechSettings extends PreferenceActivity implements * startActivityForResult. */ private static final int VOICE_DATA_INTEGRITY_CHECK = 1977; - /** - * Request code (arbitrary value) for voice data installation through - * startActivityForResult. - */ - private static final int VOICE_DATA_INSTALLATION = 1980; @Override protected void onCreate(Bundle savedInstanceState) { @@ -218,13 +213,14 @@ public class TextToSpeechSettings extends PreferenceActivity implements PackageManager pm = getPackageManager(); Intent intent = new Intent(); intent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); List resolveInfos = pm.queryIntentActivities(intent, 0); // query only the package that matches that of the default engine for (int i = 0; i < resolveInfos.size(); i++) { ActivityInfo currentActivityInfo = resolveInfos.get(i).activityInfo; if (mDefaultEng.equals(currentActivityInfo.packageName)) { intent.setClassName(mDefaultEng, currentActivityInfo.name); - this.startActivityForResult(intent, VOICE_DATA_INSTALLATION); + this.startActivity(intent); } } }