title: Requesting the Write External Storage Permission
body: <p>I have a button that when pressed, asks once, but if it says no, it does not ask me again</p>
  
  <p>How can I indicate that if he says no, he can ask again?</p>
  
  <p><strong>Check Permission</strong></p>
  
  <pre><code>            if (Build.VERSION.SDK_INT &gt;= 23){
  
              if (checkPermission()){
                  // Code for above or equal 23 API Oriented Device
                  // Your Permission granted already .Do next code
              } else {
                  requestPermission(); // Code for permission
              }
          }
          else{
              // Code for Below 23 API Oriented Device
              // Do next code
          }
  </code></pre>
  
  <p><strong>My Code Permission - Main.java</strong></p>
  
  <pre><code>private boolean checkPermission() {
      int result = ContextCompat.checkSelfPermission(Main.this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE);
      if (result == PackageManager.PERMISSION_GRANTED) {
          return true;
      } else {
          return false;
      }
  }
  
  private void requestPermission() {
  
      if (ActivityCompat.shouldShowRequestPermissionRationale(Main.this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
          Toast.makeText(Main.this, "NECESITAMOS QUE NOS CONCEDAS LOS PERMISOS DE ALMACENAMIENTO PARA GUARDAR NOTICIAS O RADIOS COMO FAVORITOS.", Toast.LENGTH_LONG).show();
      } else {
          ActivityCompat.requestPermissions(Main.this, new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE);
      }
  }
  
  @Override
  public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
      switch (requestCode) {
          case PERMISSION_REQUEST_CODE:
              if (grantResults.length &gt; 0 &amp;&amp; grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                  Log.e("value", "Permiso otorgado, ahora puedes usar la unidad local.");
              } else {
                  Log.e("value", "Permiso denegado, no puede usar la unidad local.");
              }
              break;
      }
  }
  </code></pre>