From 8fe9869955f4c85ccc2f3cb11dfbfdb253318ea1 Mon Sep 17 00:00:00 2001 From: satok Date: Wed, 28 Sep 2011 12:01:22 +0900 Subject: [PATCH] Fix the behavior of preference in IME Settings Change-Id: I41f7c36fb73730248dcc98abbf4276ef6d772f36 --- .../inputmethod/InputMethodPreference.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/com/android/settings/inputmethod/InputMethodPreference.java b/src/com/android/settings/inputmethod/InputMethodPreference.java index 4b926e22741..f222b88ae96 100644 --- a/src/com/android/settings/inputmethod/InputMethodPreference.java +++ b/src/com/android/settings/inputmethod/InputMethodPreference.java @@ -104,16 +104,18 @@ public class InputMethodPreference extends CheckBoxPreference mSummaryText = (TextView)view.findViewById(android.R.id.summary); final boolean hasSubtypes = mImi.getSubtypeCount() > 1; final String imiId = mImi.getId(); - mInputMethodPref.setOnLongClickListener(new OnLongClickListener() { - @Override - public boolean onLongClick(View arg0) { - final Bundle bundle = new Bundle(); - bundle.putString(Settings.EXTRA_INPUT_METHOD_ID, imiId); - startFragment(mFragment, InputMethodAndSubtypeEnabler.class.getName(), - 0, bundle); - return true; - } - }); + if (hasSubtypes) { + mInputMethodPref.setOnLongClickListener(new OnLongClickListener() { + @Override + public boolean onLongClick(View arg0) { + final Bundle bundle = new Bundle(); + bundle.putString(Settings.EXTRA_INPUT_METHOD_ID, imiId); + startFragment(mFragment, InputMethodAndSubtypeEnabler.class.getName(), + 0, bundle); + return true; + } + }); + } if (mSettingsIntent != null) { mInputMethodSettingsButton.setOnClickListener(