我正在使用 Google Maps v2 Android sdk,当将应用程序的区域设置更改为亚美尼亚语时, map 不显示街道名称(仅以英文显示其中一些)。
用于更改语言环境的代码:
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
最佳答案
目前,某些语言只能使用 v3.1.0 Beta Maps SDK for Android 客户端库提供服务。我会试一试。
按照迁移指南 https://goo.gle/v3-migration-guide
这是一个测试版,请在问题跟踪器的新组件中提供您的反馈 [https://goo.gle/gmp-android-sdk-beta-issues],以帮助尽快退出测试版。
关于android - 如何修复 Google Maps Android v2 上的语言环境问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52829364/