code: public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
      switch (requestCode) {
        case REQUEST_PERMISSIONS_CODE:
          if (listener != null) {
            boolean granted = grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED;
            listener.onPermissionResult(granted);
          }
          break;
        default:
          // Ignored
      }
    }
docs: You should call this method from your activity onRequestPermissionsResult.
  
  @param requestCode  The request code passed in requestPermissions(android.app.Activity, String[], int)
  @param permissions  The requested permissions. Never null.
  @param grantResults The grant results for the corresponding permissions which is either
  PERMISSION_GRANTED or PERMISSION_DENIED. Never null.