title: Requesting a permission in Android | Cannot resolve symbol MY_PERMISSIONS_REQUEST_READ_CONTACTS
body: <p>I am trying to access the user's files, and I have tried it this way:</p>
  
  <pre><code>if (ContextCompat.checkSelfPermission(MainActivity.this,
              Manifest.permission.READ_EXTERNAL_STORAGE)
              != PackageManager.PERMISSION_GRANTED) {
  
          // Permission is not granted
          if (ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this,
                  Manifest.permission.READ_EXTERNAL_STORAGE)) {
          } else {
              ActivityCompat.requestPermissions(MainActivity.this,
                      new String[]{Manifest.permission.READ_CONTACTS},
                      MY_PERMISSIONS_REQUEST_READ_CONTACTS);
          }
      } else {
          // Permission has already been granted
      }
  </code></pre>
  
  <p>Just like <a href="https://developer.android.com/training/permissions/requesting#java" rel="nofollow noreferrer">here</a></p>
  
  <p>Now Android Studio tells me: Cannot resolve symbol MY_PERMISSIONS_REQUEST_READ_CONTACTS</p>
  
  <p>Why is this?</p>
  
  <p>I'm sorry if this question has been asked before, but I have looked and I couldn't find an answer to my problem.</p>
  
  <p>Thanks in advance</p>
  
  <p>Max</p>