You can "forget" about it by clearing the data from the application settings.
EDIT: As @me_ pointed out, simply clearing the application data cannot reset the βdo not ask againβ condition on some devices. In such cases, manually turning on and then turning off permissions in the application settings will help.
But if you want to find out if permission is set for the second request, you can check it programmatically using the onRequestPermissionsResult() method.
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { for(String permission: permissions){ if(ActivityCompat.shouldShowRequestPermissionRationale(this, permission)){ //denied }else{ if(ActivityCompat.checkSelfPermission(this, permission) == PackageManager.PERMISSION_GRANTED){ //allowed } else{ //set to never ask again Log.e("set to never ask again", permission); } } } }
PS: I answered the full implementation to this answer.
source share