Android running thread in background
I am developing an app that has in a database a set of times. The app has
to run a thread at those times (5 minutes before each) each day. The way
I'm doing it now is running a thread in the background every half-minute
and checking if the time now matches a time in the DB. This is not working
and I'm afraid the thread stops running after a while (I have a
notification which should come up each time, and it is not happening).
What I'm guessing is happening is that each time the phone turn off it
screen, my app is stopped. How can I resolve this? I heard something about
AlarmManager but failed to know how to use it.. Thanks!
No comments:
Post a Comment