summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsatok <satok@google.com>2011-07-21 15:32:28 +0900
committersatok <satok@google.com>2011-07-22 07:48:29 +0900
commit5e9c5e7bcfbdc3d61f80bc95d16a7d57a362bc39 (patch)
tree6c1a79a63fdef03e8176db095e6b0ad26b19ec4b
parentc29c6d3f8cec4e326cb1ca7417f383253eb717c9 (diff)
downloadpackages_apps_settings-5e9c5e7bcfbdc3d61f80bc95d16a7d57a362bc39.zip
packages_apps_settings-5e9c5e7bcfbdc3d61f80bc95d16a7d57a362bc39.tar.gz
packages_apps_settings-5e9c5e7bcfbdc3d61f80bc95d16a7d57a362bc39.tar.bz2
Allow applications to set the title of the subtype enabler
Bug: 5058105 Change-Id: Id5e4ccbdf4f830ce5c67232f530d73679d9e038f
-rw-r--r--AndroidManifest.xml2
-rw-r--r--src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java15
2 files changed, 14 insertions, 3 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 4ce4fb9..69ec091 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -347,7 +347,7 @@
</activity>
<activity android:name=".inputmethod.InputMethodAndSubtypeEnablerActivity"
- android:label="@string/input_methods_and_subtype_enabler_title"
+ android:label=""
android:clearTaskOnLaunch="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
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());