code: public boolean isValid(int expectedRequestCode) {
          Uri uri = intent != null ? intent.getData() : null;
          if (uri == null) {
              Log.d(TAG, "Result is invalid: Received Intent's Uri is null.");
              return false;
          }
  
          if (requestCode == MISSING_REQUEST_CODE) {
              return true;
          }
  
          boolean fromRequest = getRequestCode() == expectedRequestCode;
          if (!fromRequest) {
              Log.d(TAG, String.format("Result is invalid: Received Request Code doesn't match the expected one. Was %d but expected %d", getRequestCode(), expectedRequestCode));
          }
          return fromRequest && resultCode == Activity.RESULT_OK;
      }
docs: Checks if the received data is valid and can be parsed.
  
  @param expectedRequestCode the request code this activity is expecting to receive
  @return whether if the received uri data can be parsed or not.