tbruyelle/RxPermissions

返回状态问题

Closed this issue · 3 comments

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

                                   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();
                                   }

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

Please write the issue in english.