C cyiwin Active Member Licensed User Longtime User Sep 4, 2015 #1 I saw a post similar to this but it didn't solve my problem. I have a strategy game that goes back and forth between 2 activity modules. I use KeepAlive to keep the phone from sleeping while the game is being played. If I put KeepAlive in both Activity_Resumes and ReleaseKeepAlive in both Activity_Pauses then the phone will try to go to sleep between modules and causes issues. If I put KeepAlive once at the start of the game and ReleaseKeepAlive on any possible exits, what if the user pushes the Home button? I don't want their phone to stay awake while my game isn't on the screen either. Any other options?
I saw a post similar to this but it didn't solve my problem. I have a strategy game that goes back and forth between 2 activity modules. I use KeepAlive to keep the phone from sleeping while the game is being played. If I put KeepAlive in both Activity_Resumes and ReleaseKeepAlive in both Activity_Pauses then the phone will try to go to sleep between modules and causes issues. If I put KeepAlive once at the start of the game and ReleaseKeepAlive on any possible exits, what if the user pushes the Home button? I don't want their phone to stay awake while my game isn't on the screen either. Any other options?
Erel B4X founder Staff member Licensed User Longtime User Sep 6, 2015 #2 You can use a service to handle the lock. The simplest solution is to use a timer to check every 60 seconds whether there is any running activity. Upvote 0
You can use a service to handle the lock. The simplest solution is to use a timer to check every 60 seconds whether there is any running activity.