Merge "Save instance to avoid crash opon restore in onCreate." into oc-dev
diff --git a/src/com/android/settings/tts/TextToSpeechSettings.java b/src/com/android/settings/tts/TextToSpeechSettings.java
index 37993bf..0dfdab6 100644
--- a/src/com/android/settings/tts/TextToSpeechSettings.java
+++ b/src/com/android/settings/tts/TextToSpeechSettings.java
@@ -265,6 +265,19 @@
}
}
+ @Override
+ public void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+
+ // Save the mLocalePreference values, so we can repopulate it with entries.
+ outState.putCharSequenceArray(STATE_KEY_LOCALE_ENTRIES,
+ mLocalePreference.getEntries());
+ outState.putCharSequenceArray(STATE_KEY_LOCALE_ENTRY_VALUES,
+ mLocalePreference.getEntryValues());
+ outState.putCharSequence(STATE_KEY_LOCALE_VALUE,
+ mLocalePreference.getValue());
+ }
+
private void initSettings() {
final ContentResolver resolver = getContentResolver();