本地化在android Jellybean 4.2.2中不起作用
本地化在Jellybeans 4.2.2中不起作用,我正在使用这段代码,它可以很好地在上层设备上工作——当更改手机的语言时,它可以工作。 有什么解决办法吗本地化在android Jellybean 4.2.2中不起作用,android,android-studio,localization,android-4.2-jelly-bean,Android,Android Studio,Localization,Android 4.2 Jelly Bean,本地化在Jellybeans 4.2.2中不起作用,我正在使用这段代码,它可以很好地在上层设备上工作——当更改手机的语言时,它可以工作。 有什么解决办法吗 Resources resources = context.getResources(); DisplayMetrics dm = resources.getDisplayMetrics(); Configuration config = resources.getConfiguration(); if (Build
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);
有人能帮我一下吗?你把你的最小skd设置为jellybean了吗?我的min SDK是17,应用在jellybean中运行良好,但本地化不起作用。你把你的最小skd设置为jellybean了吗?我的min SDK是17,应用在jellybean中运行良好,但本地化不起作用