更改运行时权限的语言 [英] change the language of runtime permission

查看:60
本文介绍了更改运行时权限的语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在android中更改运行时权限的语言?

How to change the language of runtime permissions in android?

当我尝试使用

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?

让用户更改其设备语言.

Have the user change their device language.

最多,您的方法将更改应用程序流程使用的语言(尽管在Android N上可能会更改).系统提供的任何UI(例如权限对话框)都将使用用户为其设备选择的语言.

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.

这篇关于更改运行时权限的语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆