Running in the dark

boten

Active Member
Licensed User
Longtime User
When an app is running and the screen darkens (as per the phone setting) the program pauses.
Is there a way to keep the prog running (in case NO other app is taking its place)?

The situation is as follows:
1) The prog has a timer running
2) The timer is disabled on Activity_Pause and enabled on Activity_Resume - so that when another app is running I want my app to halt its timer
3) BUT - in case that the screen just goes dark, I want the app to continue "ticking" away

I know I can keep it "ticking" while paused (just keep the timer enabled), but I want to keep it "ticking" only when the screen darkens.

So, is there a way to know if the Activity_Pause is caused by the screen going dark or by another app?
 
Top