Skip to content
This repository has been archived by the owner on Aug 26, 2019. It is now read-only.

MIUI8.0 #60

Open
xiayanshen opened this issue May 25, 2018 · 0 comments
Open

MIUI8.0 #60

xiayanshen opened this issue May 25, 2018 · 0 comments

Comments

@xiayanshen
Copy link

你好,MIUI8.0 一直提示打开读写权限,但是我的读写权限已经打开了,测试的其他小米手机么有问题,其他的8.0系统手机也没有问题
Permissions4M.get(UpdateDialogActivity.this)
// 是否强制弹出权限申请对话框,建议为 true,默认为 true
// .requestForce(true)
// 是否支持 5.0 权限申请,默认为 false
// .requestUnderM(false)
// 权限
.requestPermissions(Manifest.permission.WRITE_EXTERNAL_STORAGE)
// 权限码
.requestCodes(EXTERNAL_STORAGE_REQ_CODE)
// 权限请求结果
.requestListener(new Wrapper.PermissionRequestListener() {
@OverRide
public void permissionGranted(int code) {
// ToastUtils.showToast(UpdateDialogActivity.this, "读取外部存储权限成功");
startDownLoad();
}

                            @Override
                            public void permissionDenied(int code) {
                                ToastUtils.showToast(UpdateDialogActivity.this, "需要打开读取存储空间权限");
                            }

                            //二次授权时回调
                            @Override
                            public void permissionRationale(int code) {
                                ToastUtils.showToast(UpdateDialogActivity.this, "需要打开读取存储空间权限");
                            }
                        })
                        // 二次请求时回调
                        .requestCustomRationaleListener(new Wrapper.PermissionCustomRationaleListener() {
                            @Override
                            public void permissionCustomRationale(int code) {
                                Permissions4M.get(UpdateDialogActivity.this)
                                        .requestOnRationale()
                                        .requestPermissions(Manifest.permission.WRITE_EXTERNAL_STORAGE)
                                        .requestCodes(EXTERNAL_STORAGE_REQ_CODE)
                                        .request();
                            }
                        })
                        // 权限完全被禁时回调函数中返回 intent 类型(手机管家界面)
                        .requestPageType(Permissions4M.PageType.MANAGER_PAGE)
                        // 权限完全被禁时回调函数中返回 intent 类型(系统设置界面)

// .requestPageType(Permissions4M.PageType.ANDROID_SETTING_PAGE)
// 权限完全被禁时回调,接口函数中的参数 Intent 是由上一行决定的
.requestPage(new Wrapper.PermissionPageListener() {

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant