am 4e658ba9: Fix an NPE

* commit '4e658ba969830e8c9617dc8938271df1ed09aa44':
  Fix an NPE
This commit is contained in:
Jean Chalard
2011-09-02 08:12:22 -07:00
committed by Android Git Automerger
2 changed files with 4 additions and 3 deletions

View File

@@ -141,8 +141,10 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
// not present or disabled. In this case we need to remove the preference. // not present or disabled. In this case we need to remove the preference.
getPreferenceScreen().removePreference(userDictionaryPreference); getPreferenceScreen().removePreference(userDictionaryPreference);
} else if (localeList.size() <= 1) { } 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.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 // 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 // extras. This will be interpreted by the UserDictionarySettings class as
// meaning "the current locale". // meaning "the current locale".

View File

@@ -35,7 +35,7 @@ import java.util.TreeSet;
public class UserDictionaryList extends SettingsPreferenceFragment { 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"; "android.settings.USER_DICTIONARY_SETTINGS";
@Override @Override
@@ -101,7 +101,6 @@ public class UserDictionaryList extends SettingsPreferenceFragment {
newPref.getExtras().putString("locale", locale); newPref.getExtras().putString("locale", locale);
} }
newPref.setIntent(intent); newPref.setIntent(intent);
newPref.setFragment(UserDictionarySettings.class.getName());
return newPref; return newPref;
} }