You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

同是Android 14系统,部分机型应用内语言切换生效另一部分无效的问题求助

同是Android 14系统,部分机型应用内语言切换生效另一部分无效的问题求助

大家好,我碰到一个头疼的问题:同样是运行Android 14系统,我的Galaxy S23 Ultra能正常切换应用内的语言区域,但Galaxy A14 5G怎么试都不行,切换后语言完全没变化。我实在找不到哪里出错了,下面是我当前用的切换代码:

String languageToLoad = "es";
Locale locale = new Locale(languageToLoad);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;

MainActivity.this.getResources().updateConfiguration(config, MainActivity.this.getResources().getDisplayMetrics());

Intent intent = new Intent(MainActivity.this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);

我已经尝试过两种方法,但都没效果:

  • 修改了xml字符串文件的命名,现在是values-es
  • 把bundle语言的enableSplit设置为false

有没有其他可行的解决办法?

备注:内容来源于stack exchange,提问作者Jeffrey Lima

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.14 08:59:34