In my app, I require NFC (though, anyone who requires GPS would also run into this). In my MainActivity, I check to make sure NFC is enabled in my onResume
method.
When someone pulls down the Notification bar, they could opt to change many settings at the very top including GPS and NFC. I was surprised to learn that the app does not call onPause
when the notification menu is pulled down. By disabling NFC through the notification menu, the user is bypassing a layer of my app (at least temporarily).
Is there any way to mitigate this? I suppose I could continuously check if NFC is on once every few seconds, but I think that is overkill.
A very sketchy way of doing it would be to somehow hook into the fact that the screen dims as you pull down, and lightens back up as you push up the notification menu... That might just be my phone though. This is rather cumbersome.