code: private void showExplanation() {
          Snackbar.make(findSuitableView(), getString(R.string.activity_gallery_permission_request_explanation), Snackbar.LENGTH_INDEFINITE)
                  .setAction(R.string.activity_gallery_permission_request_settings, new View.OnClickListener() {
                      @Override
                      public void onClick(View v) {
                          Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
                                  Uri.fromParts("package", getPackageName(), null));
                          intent.addCategory(Intent.CATEGORY_DEFAULT);
                          intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                          startActivityForResult(intent, REQUEST_APP_SETTINGS);
                      }
                  })
                  .show();
      }
docs: Show UI with rationale for requesting a storage permission.
  <p>
  "You should do this only if you do not have the permission and the context in
  which the permission is requested does not clearly communicate to the user
  what would be the benefit from granting this permission."
  </p>