Android M – check runtime permission – how to determine if the user checked “Never ask again”?

According to this: http://developer.android.com/preview/features/runtime-permissions.html#coding an app can check for runtime permissions and request permissions if it hasn’t been granted already. The following dialog will be displayed then:

enter image description here

In case the user declines an important permission, imo an app should display an explanation why the permission is needed and what impact declining has. That dialog has two options:

  1. re-try again (permission is requested again)
  2. deny (app will work without that permission).

If the user checks Never ask again however, the second dialog with the explanation shouldn’t be shown, especially if the user already declined once before.
Now the question is: how does my app know whether the user has checked the Never ask again? IMO the onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) doesn’t give me that information.

A second question would be: does Google have plans to incorporate a custom message in the permission dialog that would explain why the app needs the permission? That way there would never be a second dialog which would certainly make for a better ux.

29 Answers
29

Leave a Comment