In my application I want to do a repeatable job on firing a certain condition onward. Whi开发者_Python百科ch one is a good idea to do the job - service or alarm manager. Lets say I want to do certain job every 10 mins if a condition is satisfied. If I declare an alarm manager in an activity, can it run independently after that activity is killed also? Or should I create a service and start an alarm manager there and do the job every 10 mins?
If you want to run the any task after the activity killed then I think you should use Service instead of alarm manager.
And if its only for a activity scope then you can use alarm manager.
EDIT: So make a independent service then use a alarm manager in it and do your stuff what you want.
Thanks.
Use service and thread concept for this problem.
精彩评论