SDK: Fix CustomLocale to properly setup Language+Country

SDK BUG 2154263

Change-Id: I74db5bc237921ff6a6fd55664a2a3c62f544081b
This commit is contained in:
Raphael
2009-10-02 11:18:10 -07:00
parent 480332f6c5
commit ef1337876b

View File

@@ -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