1

We have upgraded our application to Android M and now it asks for user access before using any of the permissions in dangerous permission set introduced in Android M.

A pop up will be shown to user asking for access. if user chooses to deny access as expected we disallow user from user from using feature , but again request user for access.

While the user access pop up shown if user checks never ask again checkbox and chooses to deny access... no pop up for user access will be shown further. But since access to permission is critical so some how we want to let user know that a critical permission access is missing.

How to handle this situation.

Thanks

Relsell
  • 771
  • 6
  • 18

1 Answers1

5

Check the ActivityCompat.shouldShowRequestPermissionRationale() call. This will check for you if you already asked for permission and if it was rejected. So you can easily find out if it is a good idea to ask the user or not.

If the user clicked on ask never again you can send your user to your app settings with this code:

Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", getContext().getPackageName(), null);
intent.setData(uri);
startActivityForResult(intent, REQUEST_PERMISSION_SETTING);
rekire
  • 47,260
  • 30
  • 167
  • 264