0

I would like to know if there is a way to detect if a user manually toggled the LOCATION PERMISSION of my app.

It seems that turning the LOCATION PERMISSION on/off restarts my app.

How can this be handled?

I've tried to add breakpoints to onSave/RestoreInstanceState calls of my activity but they are not getting called.

If anyone can point me in the right direction, it would be very much appreciated. Thanks!

momoja
  • 938
  • 9
  • 23

1 Answers1

3

I would like to know if there is a way to detect if a user manually toggled the LOCATION PERMISSION of my app.

Not in real time. The next time the user runs your app, when you check to see if you have the permission, you will find that you do not. Normally, you handle this case the same as if the user had never granted you the permission before (e.g., it's the first time the user ran your app after installing it).

It seems that turning the LOCATION PERMISSION on/off restarts my app.

No. If the user disables a permission that was granted previously, your process is terminated. But, you are in the background when this occurs (exception: multi-window). But, your process can be terminated when your app is in the background, for any reason (e.g., user installed a task killer), and so specifically worrying about permission revocation as the trigger usually is not needed.

Is there something like configChanges for permissions?

No.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491