summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/LanguageSettings.java
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2010-03-09 15:03:53 -0800
committerAmith Yamasani <yamasani@google.com>2010-03-09 15:03:53 -0800
commite086d9ad6118d2a7a3132305c2e7d719cd6fe030 (patch)
treed9917926b354e6784e85acf2bc765a74ede30851 /src/com/android/settings/LanguageSettings.java
parent29a6e1caa1b9a568e8cd3d38f94049baad960782 (diff)
downloadpackages_apps_settings-e086d9ad6118d2a7a3132305c2e7d719cd6fe030.zip
packages_apps_settings-e086d9ad6118d2a7a3132305c2e7d719cd6fe030.tar.gz
packages_apps_settings-e086d9ad6118d2a7a3132305c2e7d719cd6fe030.tar.bz2
Use a queried package name for the IME settings activity.
This fixes a bug that if the package name of the IME settingsActivity is different from it's class name, it wouldn't find the activity. This allows the package name to be optionally specified in the XML or it will be queried, for proper intent resolution. Change-Id: Ib9e6e8ef7d59ad9e88300529873eed2b39fe9981
Diffstat (limited to 'src/com/android/settings/LanguageSettings.java')
-rw-r--r--src/com/android/settings/LanguageSettings.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/settings/LanguageSettings.java b/src/com/android/settings/LanguageSettings.java
index 61ede0d..4d1f994 100644
--- a/src/com/android/settings/LanguageSettings.java
+++ b/src/com/android/settings/LanguageSettings.java
@@ -120,7 +120,11 @@ public class LanguageSettings extends PreferenceActivity {
// If setting activity is available, add a setting screen entry.
if (null != property.getSettingsActivity()) {
PreferenceScreen prefScreen = new PreferenceScreen(this, null);
- prefScreen.setKey(property.getSettingsActivity());
+ String settingsActivity = property.getSettingsActivity();
+ if (settingsActivity.lastIndexOf("/") < 0) {
+ settingsActivity = property.getPackageName() + "/" + settingsActivity;
+ }
+ prefScreen.setKey(settingsActivity);
prefScreen.setTitle(label);
if (N == 1) {
prefScreen.setSummary(getString(R.string.onscreen_keyboard_settings_summary));
@@ -274,6 +278,11 @@ public class LanguageSettings extends PreferenceActivity {
String activityName = pref.getKey();
String packageName = activityName.substring(0, activityName
.lastIndexOf("."));
+ int slash = activityName.indexOf("/");
+ if (slash > 0) {
+ packageName = activityName.substring(0, slash);
+ activityName = activityName.substring(slash + 1);
+ }
if (activityName.length() > 0) {
Intent i = new Intent(Intent.ACTION_MAIN);
i.setClassName(packageName, activityName);