我是使用Google Maps v2 Android SDK的,当我把应用切换到亚美尼亚语环境时,地图上不显示街道名称(只有一些用英文显示)。
用于更改环境的代码:
用于更改环境的代码:
private static Context setLocale(Context context, String language) {
Locale locale = new Locale(language);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration config = new Configuration(resources.getConfiguration());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
config.setLocale(locale);
context = context.createConfigurationContext(config);
} else {
config.locale = locale;
resources.updateConfiguration(config, resources.getDisplayMetrics());
}
return context;
}
我知道有一个与另一种语言相关的问题: https://issuetracker.google.com/issues/36823099