optimize permission requester

androidx
Zhanty 5 years ago
parent a9dbb35534
commit 8b2184e882
  1. 8
      lib_base/src/main/java/com/android/base/permission/PermissionCallerImpl.java

@ -71,8 +71,12 @@ class PermissionCallerImpl implements EasyPermissions.PermissionCaller {
getPermissionUIProvider()
.showAskAgainDialog(mContextWrapper.getContext(), perms.toArray(new String[0]),
(dialog, which) -> {
Intent intentForPermission = EasyPermissions.getIntentForPermission(mContextWrapper.getContext());
mContextWrapper.startActivityForResult(intentForPermission, REQUEST_PERMISSION_FOR_SETTING, null);
try {
Intent intentForPermission = EasyPermissions.getIntentForPermission(mContextWrapper.getContext());
mContextWrapper.startActivityForResult(intentForPermission, REQUEST_PERMISSION_FOR_SETTING, null);
} catch (Exception e) {
notifyPermissionDenied(perms);
}
},
(dialog, which) -> notifyPermissionDenied(perms));
} else {

Loading…
Cancel
Save