GitHub地址:https://github.com/yanzhenjie/AndPermission
AndPermission.with(activity).runtime().permission(Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION) .onGranted(new Action<List<String>>() { @Override public void onAction(List<String> permissions) { LogUtil.debug("==checkCamera==", "---------有权限了"); Log.d(TAG, "onAction(List<String>) called in onGranted, permissions: " + permissions); } }) .onDenied(new Action<List<String>>() { @Override public void onAction(List<String> data) { LogUtil.debug("==checkCamera==", "---------没有权限"); Log.d(TAG, "onAction(List<String>) called in onDenied, data: " + data); } }).start();