Merge "Save instance to avoid crash opon restore in onCreate." into oc-dev

am: dc322cf18b

Change-Id: I2644bd82b82b89f15548de58c76c751162122f7f
This commit is contained in:
Niels Egberts
2017-04-13 16:30:56 +00:00
committed by android-build-merger

View File

@@ -265,6 +265,19 @@ public class TextToSpeechSettings extends SettingsPreferenceFragment
}
}
@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();