Android Question Activity_resume and lock screen problem

Jack Cole

Well-Known Member
Licensed User
Longtime User
I have a game that pauses in Activity_pause and automatically resumes in Activity_resume. This works fine on some devices, and does not work on others. Specifically, the issue is when you suspend the device, and turn it back on. When it is waiting at the Lock Screen, Activity_resume is called on some devices (such as Samsung phones), and they game timer starts to count down even though the app is behind the lock screen. Other devices don't call Activity_resume until the lock screen is unlocked.

Any ideas on how to handle this? I wouldn't be that concerned about it, but Samsung apps won't approve an update on my app until this is fixed.

Best regards,
Jack
 

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello Jack,
If I do well understand your question, you don't want your app to run when the screen is locked ? If yes, may I suggest you to use the Phone library and especially UserPresent. You could check if the screen state is "unlocked" and then start your timers.
Hope this can help :)
 
Upvote 0

Similar Threads

Top