不推荐使用Android context.getResources.updateConfiguration()就在最近的context.getResources()。updateConfiguration()已在Android API 25中弃用,建议使用上下文。而是createConfigurationContext()。有谁知道createConfigurationContext如何用于覆盖android系统区域设置?在此之前将通过以下方式完成:Configuration config = getBaseContext().getResources().getConfiguration();config.setLocale(locale);context.getResources().updateConfiguration(config,
context.getResources().getDisplayMetrics());
3 回答
![?](http://img1.sycdn.imooc.com/533e4d2600013fe202000200-100-100.jpg)
FFIVE
TA贡献1797条经验 获得超6个赞
可能是这样的:
Configuration overrideConfiguration = getBaseContext().getResources().getConfiguration();overrideConfiguration.setLocales(LocaleList);Context context = createConfigurationContext(overrideConfiguration);Resources resources = context.getResources();
- 3 回答
- 0 关注
- 867 浏览
添加回答
举报
0/150
提交
取消