3 回答
TA贡献1876条经验 获得超7个赞
报警经理
onReceive()
onReceive()
onReceive()
Context.startService()
BroadcastReceiver
Service
定时器
timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { synchronized public void run() { \\ here your todo; } }}, TimeUnit.MINUTES.toMillis(1), TimeUnit.MINUTES.toMillis(1));
Timer
ScheduledThreadPoolExecutor
ScheduledThreadPoolExecutor.
java.util.Timer
ScheduledThreadPoolExecutor
ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();scheduler.scheduleAtFixedRate (new Runnable() { public void run() { // call service } }, 0, 10, TimeUnit.MINUTES);
ScheduledExecutorService
Timer
ScheduledThreadPoolExecutor
AlarmManager
.
警报管理器适用于您希望在特定时间运行应用程序代码的情况,即使您的应用程序当前没有运行。
TA贡献1813条经验 获得超2个赞
定时器
ScheduledThreadPoolExecutor
AlarmManager
服务
AlarmManager的BroadCastReciever
AlarmManager
AlarmManager.INTERVAL_DAY
- 3 回答
- 0 关注
- 523 浏览
添加回答
举报