code: public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
  		if (requestCode == permissionRequestCode) {
  			if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
  				if (onRequestPermissionsResultListener != null) {
  					onRequestPermissionsResultListener.onRequestPermissionsGranted();
  				}
  			} else {
  				if (onRequestPermissionsResultListener != null) {
  					onRequestPermissionsResultListener.onRequestPermissionsDenied();
  				}
  
  				if (previouslyShouldShowRequestPermissionRationale != null && !previouslyShouldShowRequestPermissionRationale && !permissionDelegate.shouldShowRequestPermissionRationale(permission)) {
  					//Note: onRequestPermissionsResult(...) is called immediately before onResume() (like onActivityResult(...)),
  					// if the dialog is show immediately in this case an exception occurs ("java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState").
  					pendingAppInfoDialog = true;
  				}
  			}
  		}
  	}
docs: This method must be called from the respective method of the fragment/activity.