title: Getting and observing/listening androd run-time permissions result back into application
body: <p><code>Code</code></p>
  
  <pre><code> private void pickPermissions(){
  
     showDialog("", "You have denied some necessary permissions permanently"
                      + " We will direct you to [Settings] screen, Turn on all permissions at [Settings] -&gt; [Permissions].",
              "Go To Settings", new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                      dialog.dismiss();
                      //Todo: open setting screen for permission result
                      Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
                      Uri uri = Uri.fromParts("package", getPackageName(), null);
                      intent.setData(uri);
                      startActivityForResult(intent, REQUEST_PERMISSION_SETTING);
                      //finish();
                  }
              }, "No, Close App", new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                      dialog.dismiss();
                      finish();
                  }
              },false);
  
  }
  </code></pre>
  
  <p>please guide me how to know whether user granted all permissions or not in my app using onActivityResult()? and is there any way to get the user back(automatically) to the app from settings screen once they grant all the permissions in app settings screen, without them pressing back button?</p>