android - 本地化在 android Jellybean 4.2.2 中不起作用
问题描述
本地化在 Jellybeans 4.2.2 中不起作用,我正在使用此代码,并且它在上部设备上运行良好,棒棒糖在更改手机语言时可以正常工作。给出任何解决方案
Resources resources = context.getResources();
DisplayMetrics dm = resources.getDisplayMetrics();
Configuration config = resources.getConfiguration();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
config.setLocale(new Locale(localeCode.toLowerCase()));
} else {
config.locale = new Locale(localeCode.toLowerCase());
}
resources.updateConfiguration(config, dm);
谁能帮我吗....
解决方案
推荐阅读
- php - 为什么php函数加载到错误的地方
- google-scholar - 导出 google 学者结果中的链接
- java - 从 java 中的哪个表 PreparedStatement 查询?
- visual-studio-code - 如何将 TODO 树(Visual Studio Code)扩展从活动栏移动到资源管理器栏?
- r - 无法在 R 中加载 arm 包
- graphql - 将消息返回给用户的 GraphQL 突变的自定义条件
- google-sheets - 谷歌表格多个IF(COUNTIF())可能在同一个公式中?
- java - 扫描仪输入的 Java 问题并尝试 {/// } 最后 {input.close();}
- python - Python py3dbp 分配不适合空箱的项目
- c++ - 我们不能多次使用删除运算符吗?