谷歌地图印地语

时间:2016-01-08 06:10:01

标签: android google-maps localization

我正在使用谷歌地图API来显示地图。它用英语显示谷歌地图,但我想以印地文语言显示谷歌地图内容。我正在使用此代码,但它不起作用:

          String languageToLoad = "hi"; // your language
            Locale locale = new Locale(languageToLoad);
            Locale.setDefault(locale);
            Configuration config = new Configuration();
            config.locale = locale;
                getActivity().getBaseContext().getResources().updateConfiguration(config,
                    getActivity().getBaseContext().getResources().getDisplayMetrics());

1 个答案:

答案 0 :(得分:-1)

更改语言代码:

 String languageToLoad = "hi_IN";
    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();

以下是代码链接:Android Supported Language and Locales