开发者

Multiple timerTask

In My app I want to do some operations on every 3mins, 5mins, 10 mins. In android is there any API to do it in single开发者_StackOverflow社区 Timer/thread. What is the best way to that ?


The proper way to create Timers in Android is to use Handler, as suggested here. You could create one Handler task for every interval you need.

One thing to notice is that if you need long intervals (like 3 or 5 minutes you've mentioned), your application may not running for so long. In that a case you can use and AlarmManager.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜