title: Permission granted in app by user Android M
body: <p>I want to in my app. if <code>permission</code> already granted not show <code>dialog</code> in android
    this is my code</p>
  
  <pre><code>@Override
  public void onClick(View v) {
      switch (v.getId()){
          case R.id.button:
                  requestContactsPermissions();
              break;
          case R.id.button1:
            //  requestCameraPermissions();
              Toast.makeText(mcontext, "Hello", Toast.LENGTH_LONG).show();
              break;
      }
  
  }
  
  private void requestContactsPermissions() {
  
       boolean requestPermission = PersimissionTest.requestContactsPermissions(this);
  
      if (requestPermission == true) {
          ActivityCompat.requestPermissions(this, PERMISSIONS_CONTACTS, REQUEST_ID);
  
      } else {
         ActivityCompat.requestPermissions(this, PERMISSIONS_CONTACTS, REQUEST_ID);
  
      }
  
  }
  </code></pre>
  
  <p>@Override
      public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {</p>
  
  <pre><code>    if (requestCode == REQUEST_ID) {
  
          if (PersimissionTest.verifyPermissions(grantResults)) {
  
              Toast.makeText(mcontext, "Contacts permissions granted.", Toast.LENGTH_LONG).show();
  
          } else {
              Toast.makeText(mcontext, "Contacts permissions were not granted.", Toast.LENGTH_LONG).show();
          }
  
      } else {
          super.onRequestPermissionsResult(requestCode, permissions, grantResults);
      }
  }
  </code></pre>