How can I give the user a chance to change his permissions in the App, which he has already set to granted/denied?
Let's say a user denied a permission. Later he want's to grant this permission. Is it possible? How can I do that?
How can I give the user a chance to change his permissions in the App, which he has already set to granted/denied?
Let's say a user denied a permission. Later he want's to grant this permission. Is it possible? How can I do that?
You show user a dialog asking to go to application settings and change the permission there, you have to motivate him somehow, tell why you need the permission. And you put an "Open settings" buton which triggers following function:
Yes you can do that.
There is callback if
onRequestPermissionsResult
in which you get to know if user has granted permission or not. If user has not granted permission you can again request for the same whenever required.In case user has denied the permission you can check for the permission and if he also has checked never show again, in that case you can open your own dialog explaining the need of that permission for your app and from that dialog you can take the user to the app settings where he can allow the permission if he wanted.
There are multiple ways to achieve what you are looking for:
You can create a separate View/Fragment just for this purpose enlisting all of the permissions that your app requires, from there you can call
requestPermission()
.Or you can simply prompt user for permission whenever user opens the segment of the app that requires permission to run by calling
requestPermission()
.User can also grant permission to the app from
Settings
. So It might be a good idea to direct user (via a dialog for instance) to change permission at a later time if he so wishes fromSettings
.