开发者

How to implement BroadcastReceiver to do different tasks depends on time interval

开发者 https://www.devze.com 2023-04-12 06:42 出处:网络
My application needs to show some notifications for schedules (like Alarm), based on time interval. For example:

My application needs to show some notifications for schedules (like Alarm), based on time interval.

For example:

There are 4 tasks I have setted in my application, like

Task A -> from 10:00 to 13:00
Task B -> from 15:10 to 16:00
Task C -> from 17:00 to 17:30
Task D -> from 20:00 to 23:30

So notification should be shown as

at 10:00开发者_如何学编程 Task A has started

at 13:00 Task A has ended

at 15:10 Task B has started

... and so on.

How can I implement this? Can you please provide some tutorials related to it? And if there are more than one way, which is the best way to do this?


Have a look at TimerTask

And there is some code on how to use it:

http://enos.itcollege.ee/~jpoial/docs/tutorial/essential/threads/timer.html

0

精彩评论

暂无评论...
验证码 换一张
取 消