change the language of runtime permission

倖福魔咒の 提交于 2021-02-08 15:33:06

问题


How to change the language of runtime permissions in android?

When I'm trying to change the language using

Configuration config = getBaseContext().getResources().getConfiguration();
        locale = new Locale(lang);
        Locale.setDefault(locale);
        Configuration conf = new Configuration(config);
        conf.locale = locale;
        getBaseContext().getResources().updateConfiguration(conf, getBaseContext().getResources().getDisplayMetrics());

It changes the application language but the permissions for camera such dialogs showing in english only.

Is there any way to change the permission dialog language?


回答1:


Is there any way to change the permission dialog language?

Have the user change their device language.

At most, your approach will change the language used by your app's process (though that may change on Android N). Any system-supplied UI, such as the permission dialog, will use the language chosen by the user for their device.




回答2:


for this you need to create your own dialog or change the language of your cell phone before or after changing the application language.



来源:https://stackoverflow.com/questions/36034048/change-the-language-of-runtime-permission

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