I was wondering, how to know user check "Never ask again" before calling requestPermissions
.
I had gone through Android M - check runtime permission - how to determine if the user checked "Never ask again"? but can't get a proper solution yet.
Before that, please allow me to explain my motive.
I have the following feedback dialog form.
When user tick on Reply to me explicitly, I will perform requestPermissions
if permissions is not granted yet. There can be 3 possible outcome.
1st outcome. Happens when calling requestPermissions
for 1st time
2nd outcome. Happens when calling requestPermissions
for 2nd, or more time
3rd outcome. Happens when user has ticked "Never ask again"
No dialog will be shown. requestPermissions
will never pop up any dialog. I need untick the checkbox on behalf of user, as onRequestPermissionsResult
will tell me permission is denied.
3rd outcome will produce bad user experience. As when user tick on the checkbox, it will become untick immediately.
I would like to hide Reply to me before making feedback form visible. To do this, I need to know whether user has already check "Never ask again".
shouldShowRequestPermissionRationale
doesn't help much. As, shouldShowRequestPermissionRationale
will return false in 2 cases
- User has already check "Never ask again".
requestPermissions
is never called before.
I don't find a way to differentiate between both.