Multiple Rejections = Denial
By now, probably you are used to the triad of permission options in the runtime permission dialog:
- Allow
- Deny
- Deny (and “don’t ask again”)
If the user chooses “don’t ask again”, you will not be able to ask for the permission again from within your app. The system will refuse to display the runtime permission dialog and will simply report that the permission was denied (via onRequestPermissionResult()
).
However, “don’t ask again” may not appear in the runtime permission dialog all the time. For example, in the screenshot shown earlier in this chapter, the options are:
- Only this time
- While using the app
- Deny
However, the user still can get the “don’t ask again” effect.
If you display the dialog, and the user clicks “Deny”, then later you display the dialog again and the user clicks “Deny”, then your app is treated as though the user chose “Don’t ask again”.
The two “Deny” actions do not need to be sequential, so long as the user uses the BACK button to close the dialog other times in between. So, for example, the flow could be:
- Deny
- BACK
- BACK
- BACK
- Deny
Each of those five times, the dialog would be shown, but after that second “Deny”, it is treated as “Don’t ask again”.
Trying It Out
You can see this effect in action with the PermissionCheck
sample. Uninstall the app (if you had it installed already). Re-run the app form the IDE, then tap the switch and click “Deny” on the resulting permission dialog. Do that two times, and you will find that future clicks on the switch have no practical effect, other than incrementally wearing out your smartphone screen.
Ramifications For You
Once again, this should not really cause a problem in terms of app operation. You have had to deal with “don’t ask again” in the past. This simply provides that option with a different UI.
However, if you are trying to maintain decent end-user documentation, including showing the various permission flows… well, your job just got harder.
(sorry!)
Prev Table of Contents Next
This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.