Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

点击dialog外侧,dialog也会取消,且shouldShowRequestPermissionRationale=flase #346

Open
githubxiaoou opened this issue May 24, 2021 · 3 comments

Comments

@githubxiaoou
Copy link

disposable = rxPermissions.requestEach(permission.CALL_PHONE, permission.CAMERA)
.subscribe(new Consumer() {
@OverRide
public void accept(Permission permission) throws Throwable {
if (permission.granted) {
Log.e(permission.name, "granted");
} else if (permission.shouldShowRequestPermissionRationale) {
Log.e(permission.name, "shouldShowRequestPermissionRationale");
} else {
Log.e(permission.name, "denied");
}
}
});

权限对话框是可取消的,点击dialog外侧取消后,走的也是else分支。这时候去过else里面写的是引导用户去设置页的逻辑,就不大合适。希望能够区分开:不再询问的禁止 和 点击dialog外侧取消。

@githubxiaoou
Copy link
Author

更正:点击dialog外侧取消的时候,permission.shouldShowRequestPermissionRationale取的是最近一次的赋值。

@YaweiWang
Copy link

更正:点击dialog外侧取消的时候,permission.shouldShowRequestPermissionRationale取的是最近一次的赋值。

大佬后来是怎么解决的这个问题啊

@KarlLargerFeld
Copy link

KarlLargerFeld commented Jan 4, 2024 via email

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

3 participants