diff options
author | Danny Baumann <dannybaumann@web.de> | 2013-04-21 12:58:47 +0200 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2013-04-21 12:58:47 +0200 |
commit | 1df00efd9f139e3314fae3ed7fe9431e3516728b (patch) | |
tree | ac50b9dceb1ca72a08604c5b854d3ade886a87b2 /src/com | |
parent | 7a79da634eb68522267cef3a18d229c9503675b7 (diff) | |
download | packages_apps_settings-1df00efd9f139e3314fae3ed7fe9431e3516728b.zip packages_apps_settings-1df00efd9f139e3314fae3ed7fe9431e3516728b.tar.gz packages_apps_settings-1df00efd9f139e3314fae3ed7fe9431e3516728b.tar.bz2 |
Fix NPE in Settings -> Language & input -> Default -> Setup input
methods
If the InputMethodAndLanguageSettings fragment is launched in IME-only
mode, it removes most preferences, so we need to null-check them before
use.
Change-Id: I297cc9c6885f62ed6ff65937ef5da401ab7cd271
JIRA:CYAN-896
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java index 3b70708..62c2ec1 100644 --- a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java +++ b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java @@ -39,7 +39,6 @@ import android.preference.CheckBoxPreference; import android.preference.ListPreference; import android.preference.Preference; import android.preference.PreferenceCategory; -import android.preference.PreferenceGroup; import android.preference.PreferenceScreen; import android.provider.Settings; import android.provider.Settings.System; @@ -194,10 +193,12 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment mStylusIconEnabled = (CheckBoxPreference) findPreference(KEY_STYLUS_ICON_ENABLED); // remove stylus preference for non stylus devices if (!getResources().getBoolean(com.android.internal.R.bool.config_stylusGestures)) { - PreferenceGroup pointerSettingsCategory = (PreferenceGroup) + PreferenceCategory pointerSettingsCategory = (PreferenceCategory) findPreference(KEY_POINTER_SETTINGS_CATEGORY); - pointerSettingsCategory.removePreference(mStylusGestures); - pointerSettingsCategory.removePreference(mStylusIconEnabled); + if (pointerSettingsCategory != null) { + pointerSettingsCategory.removePreference(mStylusGestures); + pointerSettingsCategory.removePreference(mStylusIconEnabled); + } } // Spell Checker |