darkchaos
darkchaos

Reputation: 197

Android M new permissions model

How can I detect if user choose in permission dialog "Don't ask again". I try to find any method for this, but doesn't find. This functionality is needed, for example, for hide some controls and don't disturb user with useless controls

Upvotes: 0

Views: 145

Answers (2)

Thomas R.
Thomas R.

Reputation: 8073

There is way. You can find a detailed explanation in the official documentation: https://developer.android.com/preview/features/runtime-permissions.html.

You can call the "shouldShowRequestPermissionRationale()" method to check if the user has clicked the "never ask again" option. If so, the method will return false.

And of cause you should know if you have presented the permission dialog once, otherwise this method will also return false.

Read the documentation :)

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1006674

If you have asked for the permission previously, and now showShowPermissionRequestRationale() returns false, the user chose "Don't ask again" on some previous permission request.

Upvotes: 3

Related Questions