As we can see in the code above, we can check status of any permission with using ContextCompat.checkSelfPermission() method. And we can request any permission with ActivityCompat.requestPermissions() method. These methods are already included in support library.

Now, if the listPermissionsNeeded is not empty, that means that at least one or more permissions have been denied. So, requestPermissions() method will show the permission dialog and will invoke onRequestPermissionsResult() callback method

Now, here’s how the whole case goes after requesting permissions. First time, android will show the permissions normally. If all are accepted, then everything goes normally. If any one or all are denied, then it shows the explanation dialog (created by developer) to tell the user why permissions are important. And this dialog will allow the user to grant permissions again. Now, android will show the permission dialog again but this time with an extra checkbox “Never ask again”.

If any of the permission has been denied with “Never ask again” check, then that permission can only be allowed from the Settings of the app. Since my app cannot work without these permissions, so I will show another dialog which will allow the user to go to Settings screen of the app and allow to grant permissions manually.

Permissions screen for the Chrome on Android