【发布时间】:2017-05-18 10:58:15
【问题描述】:
尝试使用以下方法更改 Nougat 中的应用语言,但失败了。
config.setLocales(new LocaleList(locale));
getBaseContext().createConfigurationContext(config);
但它使用以下不推荐使用的代码
getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());
为什么会这样?我做错什么了吗?
我的应用程序支持英语英国和英语美国。 系统语言还包含英语印度、英国英语和其他一些语言。 应用程序以英语美国本身加载,但如果系统语言是英语印度并且配置正确传递为 en_GB,我的默认语言应该是英语英国。 为什么会这样而不选择 en_GB ?
【问题讨论】:
标签: android localization android-7.0-nougat android-7.1-nougat