@AfterPermissionGranted(RC_CAMERA_AND_LOCATION)
private void methodRequiresTwoPermission(String str) {
String[] perms = {Manifest.permission.CAMERA, Manifest.permission.ACCESS_FINE_LOCATION};
if (EasyPermissions.hasPermissions(this, perms)) {
// Already have permission, do the thing
// ...
} else {
// Do not have permissions, request them now
EasyPermissions.requestPermissions(this, getString(R.string.camera_and_location_rationale),
RC_CAMERA_AND_LOCATION, perms);
}
}
When all the permissions of the application are allowed, the methods described above cannot execute, and only the parameters can be deleted.
@AfterPermissionGranted(RC_CAMERA_AND_LOCATION) private void methodRequiresTwoPermission(String str) { String[] perms = {Manifest.permission.CAMERA, Manifest.permission.ACCESS_FINE_LOCATION}; if (EasyPermissions.hasPermissions(this, perms)) { // Already have permission, do the thing // ... } else { // Do not have permissions, request them now EasyPermissions.requestPermissions(this, getString(R.string.camera_and_location_rationale), RC_CAMERA_AND_LOCATION, perms); } } When all the permissions of the application are allowed, the methods described above cannot execute, and only the parameters can be deleted.