Closed finger563 closed 5 years ago
For now, I'm not aware of an event that fires when the screen enters sleep. I think as far as the OS is concerned, the application (android activity) would still be running and the app in the foreground.
So our stopping of the network monitor would still be running and the network having no connection when the screen sleeps would make sense since we aren't running in the background.
Easy fix is to use a TOAST
and not an alert for now so it's not so blocking to the user when the app is resumed.
It takes several minutes (too long to test right now) for the network to stop when the app actually is paused after the screen sleeps.
I was thinking to add a flag to only show conditionally to not be annoying with the warning, but the Toast is non-blocking so it should improve the UX in this scenario.
Right now they stack while the phone screen is off so that when you turn it back on you may have 30 popups all stacked on top of each other telling you the network was changed