OSDN Git Service

Make TTS "Listen to an example" survive rotation.
authorPrzemyslaw Szczepaniak <pszczepaniak@google.com>
Wed, 28 May 2014 10:57:07 +0000 (11:57 +0100)
committerPrzemyslaw Szczepaniak <pszczepaniak@google.com>
Wed, 28 May 2014 16:04:08 +0000 (17:04 +0100)
Bug: 15019145

Change-Id: Id94e32947c58911ded3e4025653b415453cabbbb

src/com/android/settings/tts/TextToSpeechSettings.java

index 1d4fe71..4a98661 100644 (file)
@@ -28,6 +28,7 @@ import android.app.AlertDialog;
 import android.content.ActivityNotFoundException;
 import android.content.ContentResolver;
 import android.content.Intent;
+import android.os.AsyncTask;
 import android.os.Bundle;
 import android.preference.ListPreference;
 import android.preference.Preference;
@@ -164,6 +165,9 @@ public class TextToSpeechSettings extends SettingsPreferenceFragment implements
 
         setTtsUtteranceProgressListener();
         initSettings();
+
+        // Prevent restarting the TTS connection on rotation
+        setRetainInstance(true);
     }
 
     @Override