不推薦使用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 回答

FFIVE
TA貢獻1797條經驗 獲得超6個贊
可能是這樣的:
Configuration?overrideConfiguration?=?getBaseContext().getResources().getConfiguration();overrideConfiguration.setLocales(LocaleList);Context?context??=?createConfigurationContext(overrideConfiguration);Resources?resources?=?context.getResources();
- 3 回答
- 0 關注
- 885 瀏覽
添加回答
舉報
0/150
提交
取消