From 3b60858e9cc9cc38dc58209f7dc16fa51e633749 Mon Sep 17 00:00:00 2001 From: Przemyslaw Szczepaniak Date: Wed, 28 May 2014 11:57:07 +0100 Subject: [PATCH] Make TTS "Listen to an example" survive rotation. Bug: 15019145 Change-Id: Id94e32947c58911ded3e4025653b415453cabbbb --- src/com/android/settings/tts/TextToSpeechSettings.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/android/settings/tts/TextToSpeechSettings.java b/src/com/android/settings/tts/TextToSpeechSettings.java index 1d4fe712744..4a98661a1a9 100644 --- a/src/com/android/settings/tts/TextToSpeechSettings.java +++ b/src/com/android/settings/tts/TextToSpeechSettings.java @@ -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