我知道设置语言方法: IActivityManager am = ActivityManagerNative.getDefault();
try {
Configuration config = am.getConfiguration();
Log.d(TAG, "mcc="+config.mcc) ;
if(config.mcc==310||config.mnc==01){
Log.d(TAG, "set china language....................................................") ;
Locale mLocale = null ;
config.locale = mLocale.CHINA;
// indicate this isn't some passing default - the user wants this remembered
config.userSetLocale = true;
am.updateConfiguration(config);
// Trigger the dirty bit for the Settings Provider.
BackupManager.dataChanged("com.android.providers.settings");
}
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
如果没有怎么获得设置当前语言的Locale
关键就是为了拿到config.locale = mLocale.CHINA;
mLocale.getdefault 只有一个设置为默认语言的方法
怎么获得当前语言Locale ....请高手解答
try {
Configuration config = am.getConfiguration();
Log.d(TAG, "mcc="+config.mcc) ;
if(config.mcc==310||config.mnc==01){
Log.d(TAG, "set china language....................................................") ;
Locale mLocale = null ;
config.locale = mLocale.CHINA;
// indicate this isn't some passing default - the user wants this remembered
config.userSetLocale = true;
am.updateConfiguration(config);
// Trigger the dirty bit for the Settings Provider.
BackupManager.dataChanged("com.android.providers.settings");
}
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
如果没有怎么获得设置当前语言的Locale
关键就是为了拿到config.locale = mLocale.CHINA;
mLocale.getdefault 只有一个设置为默认语言的方法
怎么获得当前语言Locale ....请高手解答
我自己给自己解答把 我是想设置当前的语言
那么我就把当前语言设置成默认的语言 API里面有设置成默认语言的方法啊
然后在其他地方我在得到默认的语言 在显示取出
这样我就可以设置当前语言 就是以默认语言为桥梁
不知道行否??