tbruyelle / RxPermissions

Android runtime permissions powered by RxJava2
Apache License 2.0
10.48k stars 1.31k forks source link

返回状态问题 #290

Closed VinRichard closed 4 years ago

VinRichard commented 5 years ago

拒绝权限和拒绝不在提示的状态么法区分,不知道其他人有么有遇到这个问题

longalei commented 5 years ago
                                   if (permission.granted) {
                                       Toast.makeText(MainActivity.this,
                                               "granted permission",
                                               Toast.LENGTH_SHORT).show();
                                   } else if (permission.shouldShowRequestPermissionRationale) {
                                       // Denied permission without ask never again
                                       Toast.makeText(MainActivity.this,
                                               "Denied permission without ask never again",
                                               Toast.LENGTH_SHORT).show();
                                   } else {
                                       // Denied permission with ask never again
                                       // Need to go to the settings
                                       Toast.makeText(MainActivity.this,
                                               "Permission denied, can't enable the camera",
                                               Toast.LENGTH_SHORT).show();
                                   }
Jazero commented 4 years ago

rxPermissions.ensureEach(Manifest.permission.CAMERA) 中返回generices :<T, Permission> 。然后在用上面答案。

tbruyelle commented 4 years ago

Please write the issue in english.