在我的应用程序的应用程序类的onCreate中,我有以下代码
Locale current = getResources().getConfiguration().locale;
String language = Utils.getPhoneLanguage();
String text = getString(R.string.text);我已将电话语言设置为德语
当前为de_DE
语言是de
text是来自values/strings.xml的字符串,而不是values-de/strings.xml。
会有什么问题呢?
发布于 2016-05-23 16:33:31
public void setLocale(String lang) {
myLocale = new Locale(lang);
Resources res = getResources();
DisplayMetrics dm = res.getDisplayMetrics();
Configuration conf = res.getConfiguration();
conf.locale = myLocale;
res.updateConfiguration(conf, dm);
Intent refresh = new Intent(this, AndroidLocalize.class);
startActivity(refresh);
finish();
} 将语言传递给set
https://stackoverflow.com/questions/37385962
复制相似问题