Try this library. It will handle allis not possible to pragmatically open the permission related operations.
It can handle Never ask againscreen. It can handle DenyInstead, Itwe can callopen app settings for permission, It can give a Rational message, It can give a Denial message and etc
https://github.com/ParkSangGwon/TedPermission
check the above link for latest libraries
Step 1: add your dependency
dependencies { compile 'gun0912.ted:tedpermission:2.1.1' }
Step 2: Add below codescreen.
TedPermission.with(this) .setPermissionListener(permissionlistener) .setDeniedMessage("If you reject permission,you can not use this service\n\nPlease turn on permissions at [Setting] > [Permission]") .setPermissions(Manifest.permission.READ_CONTACTS, Manifest.permission.ACCESS_FINE_LOCATION) .check(); PermissionListenerIntent permissionlisteneri = new PermissionListener() { @Override public void onPermissionGranted() { Toast.makeTextIntent(MainActivityandroid.this, "Permission Granted", Toastprovider.LENGTH_SHORT)Settings.show(); } @Override public void onPermissionDenied(ArrayList<String> deniedPermissions) { ACTION_APPLICATION_DETAILS_SETTINGS, ToastUri.makeTextparse(MainActivity.this, "Permission Denied\n""package:" + deniedPermissions.toString(), ToastBuildConfig.LENGTH_SHORTAPPLICATION_ID).show(); } }startActivity(i);