diff options
author | satok <satok@google.com> | 2011-07-21 19:41:03 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-21 19:41:03 -0700 |
commit | dbaae5ad1762f7c01568be078c73d0a578d410d3 (patch) | |
tree | e570426b14b0bf9727c584f2bbbaa10089ff923a /src | |
parent | 554ad399a5f7114943e0f9d0725b36eafd8cc327 (diff) | |
parent | 5e9c5e7bcfbdc3d61f80bc95d16a7d57a362bc39 (diff) | |
download | packages_apps_settings-dbaae5ad1762f7c01568be078c73d0a578d410d3.zip packages_apps_settings-dbaae5ad1762f7c01568be078c73d0a578d410d3.tar.gz packages_apps_settings-dbaae5ad1762f7c01568be078c73d0a578d410d3.tar.bz2 |
Merge "Allow applications to set the title of the subtype enabler Bug: 5058105"
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java index 43d54a2..b5353d6 100644 --- a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java +++ b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java @@ -22,6 +22,7 @@ import com.android.settings.SettingsPreferenceFragment; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; +import android.content.Intent; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.os.Bundle; @@ -56,19 +57,29 @@ public class InputMethodAndSubtypeEnabler extends SettingsPreferenceFragment { Configuration config = getResources().getConfiguration(); mHaveHardKeyboard = (config.keyboard == Configuration.KEYBOARD_QWERTY); + final Bundle arguments = getArguments(); // Input method id should be available from an Intent when this preference is launched as a // single Activity (see InputMethodAndSubtypeEnablerActivity). It should be available // from a preference argument when the preference is launched as a part of the other // Activity (like a right pane of 2-pane Settings app) mInputMethodId = getActivity().getIntent().getStringExtra( android.provider.Settings.EXTRA_INPUT_METHOD_ID); - if (mInputMethodId == null && (getArguments() != null)) { + if (mInputMethodId == null && (arguments != null)) { final String inputMethodId = - getArguments().getString(android.provider.Settings.EXTRA_INPUT_METHOD_ID); + arguments.getString(android.provider.Settings.EXTRA_INPUT_METHOD_ID); if (inputMethodId != null) { 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); + } onCreateIMM(); setPreferenceScreen(createPreferenceHierarchy()); |