亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

不推薦使用Android context.getResources

不推薦使用Android context.getResources

慕容708150 2019-09-04 10:05:58
不推薦使用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();




查看完整回答
反對 回復 2019-09-09
  • 3 回答
  • 0 關注
  • 885 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號