How to change language Google Map V2 android -


i using google-play-service-lib. how can change language of google map i.e. show locations in korian language or hindi language.

you can change location google maps use google map api v2 using locale object. language needs supported on device being used though.

here full list of supported languages.

with code below able change language on map chinese:

@override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);      string languagetoload = "zh_cn";     locale locale = new locale(languagetoload);     locale.setdefault(locale);     configuration config = new configuration();     config.locale = locale;     getbasecontext().getresources().updateconfiguration(config,             getbasecontext().getresources().getdisplaymetrics());      setcontentview(r.layout.activity_maps);      setupmapifneeded();  } 

result, language set chinese in code (no manual changes) on u.s. based phone:

chinese map

i able show korean, use locale code:

 string languagetoload = "ko_kr"; 

result:

korean map

note

it looks supported languages google maps listed here: https://developers.google.com/maps/faq#languagesupport


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -