am ef133787: SDK: Fix CustomLocale to properly setup Language+Country

Merge commit 'ef1337876b2dfbf76dc7e45e035f4a25ebc0f560'

* commit 'ef1337876b2dfbf76dc7e45e035f4a25ebc0f560':
  SDK: Fix CustomLocale to properly setup Language+Country
This commit is contained in:
Raphael
2009-10-12 11:23:25 -07:00
committed by Android Git Automerger

View File

@@ -289,7 +289,15 @@ public class CustomLocaleActivity extends ListActivity {
IActivityManager am = ActivityManagerNative.getDefault(); IActivityManager am = ActivityManagerNative.getDefault();
Configuration config = am.getConfiguration(); 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; config.locale = loc;
// indicate this isn't some passing default - the user wants this // indicate this isn't some passing default - the user wants this