Alarmmanager Stops Running
I'm writing a program that should run every 10 minutes in the background. The code I have seems to work fine as long as I'm actively using my phone, but after a long period of tim
Solution 1:
Does it really have to run every ten minutes even when the device is asleep? If it doesn't, use AlarmManager.ELAPSED_REALTIME
and your service will be run when the device is wakes up, saving a lot of battery. As for your question, you can assume that the screen going dark == going to sleep (of course, if other services are holding wakelocks, that is not the case).
Post a Comment for "Alarmmanager Stops Running"