始终不授予OS 4.0上的Android Marshmallow权限模型READ_EXTERNAL_STORAGE权限 [英] Android Marshmallow permission model on OS 4.0 READ_EXTERNAL_STORAGE permission always not granted
本文介绍了始终不授予OS 4.0上的Android Marshmallow权限模型READ_EXTERNAL_STORAGE权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Android OS 4.0上运行我的应用程序并请求具有以下内容的READ_EXTERNAL_STORAGE
权限时,我遇到问题:
I have a problem when running my app on Android OS 4.0 and requesting READ_EXTERNAL_STORAGE
permission with:
ActivityCompat.requestPermissions(ctx, requestedPermissions, requestCode);
我总是在回调上
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults) {
grantResults != PackageManager.PERMISSION_GRANTED
使用ActivityCompat.checkSelfPermission
检查权限总是返回permissionDenied
.
Checking the permission with ActivityCompat.checkSelfPermission
is always returning permissionDenied
.
通过在系统对话框中请求权限,它在OS 6.0上运行良好.
除了4.0之外,Android OS 4.x始终会授予该权限.
OS 4.0中其他权限(相机,日历,联系人,电话)的行为都很好,除了READ_EXTERNAL_STORAGE
导致此问题.
It works well on OS 6.0 by requesting the permission with system dialog.
Android OS 4.x excepted the 4.0 the permission is always granted.
OS 4.0 the other permissions (Camera,Calendar,Contact,Phone) are behaving well except the READ_EXTERNAL_STORAGE
causing this issue.
也许是操作系统问题?
推荐答案
查看全文