Other languages/locales in MapView (android)

一世执手 提交于 2019-12-13 05:19:42

问题


Can anyone tell me how to set the mapview object in android so it will display streetnames in other languages, such as hebrew?


回答1:


After doing much research and playing around I found that the solution is extremely simple: in your MapActivity.onCreate method you can ovverride the default locale with one line of code, the following is for hebrew:

Locale.setDefault(new Locale("iw","IL"));

Thats it. I have verified this on my Evo 4g and nexus one. Please note that this changed the locale for your entire activity so if you have any localized resources they will be affected as well.

Hope this helps.




回答2:


Google Maps automatically displays place names in the local language of each country. While it's not possible to change the language of the place names, you can search for some major cities and locations in a number of different languages. --via Google

I'm sure it works the same way with android apps.



来源:https://stackoverflow.com/questions/8422246/other-languages-locales-in-mapview-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!