summaryrefslogtreecommitdiffstats
path: root/apps/CustomLocale
diff options
context:
space:
mode:
Diffstat (limited to 'apps/CustomLocale')
-rw-r--r--apps/CustomLocale/src/com/android/customlocale/CustomLocaleActivity.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/CustomLocale/src/com/android/customlocale/CustomLocaleActivity.java b/apps/CustomLocale/src/com/android/customlocale/CustomLocaleActivity.java
index 768f9105f..69b9c5bf2 100644
--- a/apps/CustomLocale/src/com/android/customlocale/CustomLocaleActivity.java
+++ b/apps/CustomLocale/src/com/android/customlocale/CustomLocaleActivity.java
@@ -289,7 +289,15 @@ public class CustomLocaleActivity extends ListActivity {
IActivityManager am = ActivityManagerNative.getDefault();
Configuration config = am.getConfiguration();
- Locale loc = new Locale(locale);
+ Locale loc = null;
+
+ String[] langCountry = locale.split("_");
+ if (langCountry.length == 2) {
+ loc = new Locale(langCountry[0], langCountry[1]);
+ } else {
+ loc = new Locale(locale);
+ }
+
config.locale = loc;
// indicate this isn't some passing default - the user wants this