From 16c3e74d72ec2d18aff007cb88fcf02995918a90 Mon Sep 17 00:00:00 2001 From: satok Date: Fri, 12 Aug 2011 11:45:52 +0900 Subject: [PATCH] Fix the title of the input method subtype enabler Bug: 5097548 Change-Id: If01e13bd1ab7ac851b613450018f68f7f42f1e14 --- .../InputMethodAndSubtypeEnabler.java | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java index efed8231f30..e5ce9878246 100644 --- a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java +++ b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java @@ -49,6 +49,7 @@ public class InputMethodAndSubtypeEnabler extends SettingsPreferenceFragment { private InputMethodManager mImm; private List mInputMethodProperties; private String mInputMethodId; + private String mTitle; @Override public void onCreate(Bundle icicle) { @@ -71,20 +72,26 @@ public class InputMethodAndSubtypeEnabler extends SettingsPreferenceFragment { mInputMethodId = inputMethodId; } } - CharSequence title = getActivity().getIntent().getStringExtra( - Intent.EXTRA_TITLE); - if (title == null && (arguments != null)) { - title = arguments.getString(Intent.EXTRA_TITLE); - } - - if (!TextUtils.isEmpty(title)) { - getActivity().setTitle(title); + mTitle = getActivity().getIntent().getStringExtra(Intent.EXTRA_TITLE); + if (mTitle == null && (arguments != null)) { + final String title = arguments.getString(Intent.EXTRA_TITLE); + if (title != null) { + mTitle = title; + } } onCreateIMM(); setPreferenceScreen(createPreferenceHierarchy()); } + @Override + public void onActivityCreated(Bundle icicle) { + super.onActivityCreated(icicle); + if (!TextUtils.isEmpty(mTitle)) { + getActivity().setTitle(mTitle); + } + } + @Override public void onResume() { super.onResume();