diff options
author | Jean Chalard <jchalard@google.com> | 2011-09-02 21:44:12 +0900 |
---|---|---|
committer | Jean Chalard <jchalard@google.com> | 2011-09-02 21:44:12 +0900 |
commit | 4e658ba969830e8c9617dc8938271df1ed09aa44 (patch) | |
tree | 59fbde9d685ecdf3ed15529970b791b0d2a00497 /src/com/android/settings/inputmethod | |
parent | eb913af2a663dc1a0f7d758a041503d6adf1381c (diff) | |
download | packages_apps_settings-4e658ba969830e8c9617dc8938271df1ed09aa44.zip packages_apps_settings-4e658ba969830e8c9617dc8938271df1ed09aa44.tar.gz packages_apps_settings-4e658ba969830e8c9617dc8938271df1ed09aa44.tar.bz2 |
Fix an NPE
It seems the user dictionary fragment does not tolerate being
called by name, and needs to be called only by action.
Bug: 5242122
Change-Id: I6b954db549b98d4d0076fdce8e00d336fc18b6e3
Diffstat (limited to 'src/com/android/settings/inputmethod')
-rw-r--r-- | src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java | 4 | ||||
-rw-r--r-- | src/com/android/settings/inputmethod/UserDictionaryList.java | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java index 5c85374..65e9169 100644 --- a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java +++ b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java @@ -141,8 +141,10 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment // not present or disabled. In this case we need to remove the preference. getPreferenceScreen().removePreference(userDictionaryPreference); } else if (localeList.size() <= 1) { + final Intent intent = + new Intent(UserDictionaryList.USER_DICTIONARY_SETTINGS_INTENT_ACTION); userDictionaryPreference.setTitle(R.string.user_dict_single_settings_title); - userDictionaryPreference.setFragment(UserDictionarySettings.class.getName()); + userDictionaryPreference.setIntent(intent); // If the size of localeList is 0, we don't set the locale parameter in the // extras. This will be interpreted by the UserDictionarySettings class as // meaning "the current locale". diff --git a/src/com/android/settings/inputmethod/UserDictionaryList.java b/src/com/android/settings/inputmethod/UserDictionaryList.java index 232a6db..894dd8a 100644 --- a/src/com/android/settings/inputmethod/UserDictionaryList.java +++ b/src/com/android/settings/inputmethod/UserDictionaryList.java @@ -35,7 +35,7 @@ import java.util.TreeSet; public class UserDictionaryList extends SettingsPreferenceFragment { - private static final String USER_DICTIONARY_SETTINGS_INTENT_ACTION = + public static final String USER_DICTIONARY_SETTINGS_INTENT_ACTION = "android.settings.USER_DICTIONARY_SETTINGS"; @Override @@ -101,7 +101,6 @@ public class UserDictionaryList extends SettingsPreferenceFragment { newPref.getExtras().putString("locale", locale); } newPref.setIntent(intent); - newPref.setFragment(UserDictionarySettings.class.getName()); return newPref; } |