我知道设置语言方法: 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 ....请高手解答
解决方案 »
- Android 中操作PDF。
- 如何实现类似android自带联系人快速搜索功能!
- 安卓开发里面怎么通过监听计算2点之间距离,并进行判断
- android未来发展?
- 看了android应用程序的一些感觉
- android 如何原样显示word文件里面的内容(表格,自选图形,图片,页眉,页脚)
- 联想这界跨的,真给力啊
- MainActivity中调用fragement实现导航的问题????
- 關於使用接口(介面)之疑惑?
- 求助Android Studio中TextView和EditText互相传值。
- 请教有关SimpleCursorTreeAdapter的问题
- android里面Configuration 类
我自己给自己解答把 我是想设置当前的语言
那么我就把当前语言设置成默认的语言 API里面有设置成默认语言的方法啊
然后在其他地方我在得到默认的语言 在显示取出
这样我就可以设置当前语言 就是以默认语言为桥梁
不知道行否??