Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Marshmallow - permissions state change

Is there any way for permission state change detection in Android Marshmallow?

I have not seen broadcast for that...

like image 207
itzhar Avatar asked Oct 07 '15 09:10

itzhar


2 Answers

Permissions cannot change in the middle of the app. If an permission is changed -> the app is restarted. There is no Broadcast - you have to check every-time - but it is OK to only do it at startup of your app

like image 67
ligi Avatar answered Sep 18 '22 13:09

ligi


No. You will not get any broadcast for it. On each call of a feature, which needs permission, you need to check if permission is granted or not.


Read Request App Permissions, a well documented, and covers each point which you need to take care of. It seems Google has achieved the official sample, but still, you can find some useful information from the sample. And at last watch Android Marshmallow 6.0: Asking For Permission to design your app in a better way.


Note:

Also read, Permissions updates in Android 11,

like image 36
Pankaj Kumar Avatar answered Sep 18 '22 13:09

Pankaj Kumar