Short Answer - You cannot ask Permission again if user denied and ticked Never Ask again.
But you can show some meaningful message and ask user to enable permission for your app manually. More you can redirect user to App Permission page under android settings.
You can check whether user has denied it earlier or not using shouldShowRequestPermissionRationale
.
You can read more on permissions https://developer.android.com/training/permissions/requesting
I use following codebase to implement permission check
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
if (requestCode == REQUEST_PERMISSION) {
// Permission check if the user granted/denied them you may want to group the rationale in a single dialog
for (int i = 0, len = permissions.length; i < len; i++) {
String permission = permissions[i];
if (grantResults[i] == PackageManager.PERMISSION_DENIED) {
// denied the permission
boolean showRationale = shouldShowRequestPermissionRationale( permission );
if (! showRationale) {
// User ticked "never ask again"
// Show some meaningful message
} else if (Manifest.permission.WRITE_CONTACTS.equals(permission)) {
showRationale(permission, R.string.permission_denied_contacts);
// NOT ticked "never ask again"
} else if ( /* possibly check more permissions...*/ ) {
}
}
}
}
}