In my application, I check the necessary permissions for Marshmallow devices in accordance with the recommendations of Google. When permission is required, I use the query resolution method for this:
mActivity.requestPermissions(permissionsList, MY_PERMISSIONS_REQUEST) , which displays dialog boxes similar to the dialog below:

While this dialog box is displayed, if the user clicks the back button, I would like the dialog to be rejected. Pressing the back button is currently unaffected.
Is there a way to dismiss these dialogs using the back button?
source share