我使用以下代码请求用户的权限,我的操作系统区域设置不是英语,但我的应用程序区域设置是英语,权限对话框语言基于系统区域设置。如何根据应用程序更改权限区域设置。
activitycompat.requestpermissions(this,permissionsNededList.toarray(新字符串[0]),permission\u request\u code);
public static final int PERMISSION_REQUEST_CODE = 200;
String[] APP_PERMISSIONS = {
android.Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE,
android.Manifest.permission.CAMERA
};
private boolean checkAndRequestPermission() {
List<String> permissionsNeededList = new ArrayList<>();
for (String PERMISSION : APP_PERMISSIONS) {
if(ContextCompat.checkSelfPermission(this, PERMISSION) != PackageManager.PERMISSION_GRANTED) {
permissionsNeededList.add(PERMISSION);
}
}
if (!permissionsNeededList.isEmpty()){
ActivityCompat.requestPermissions(this,
permissionsNeededList.toArray(new String[0]), PERMISSION_REQUEST_CODE);
return false;
}
return true;
}
暂无答案!
目前还没有任何答案,快来回答吧!