From b1d87850ec2cb0ef18d56fd3a3fab6ea394c0adc Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Thu, 28 Nov 2013 14:12:05 +0900 Subject: [PATCH] Fix updating list preference summary for unknown value Change-Id: I86d3162a90e0068e787a906c0d3d64102487620a --- .../android/inputmethod/latin/settings/SettingsFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java b/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java index 9666dd61a..7d307a4f1 100644 --- a/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java +++ b/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java @@ -73,7 +73,7 @@ public final class SettingsFragment extends InputMethodSettingsFragment final ListPreference listPreference = (ListPreference)findPreference(prefKey); final CharSequence entries[] = listPreference.getEntries(); final int entryIndex = listPreference.findIndexOfValue(listPreference.getValue()); - listPreference.setSummary(entries[entryIndex]); + listPreference.setSummary(entryIndex < 0 ? null : entries[entryIndex]); } private static void removePreference(final String preferenceKey, final PreferenceGroup parent) {