开发者

Know Active Timer

开发者 https://www.devze.com 2023-04-09 08:17 出处:网络
In Android, after starting any timer using TIMER or CountDownTimer, is there any way to track them? For example, if we start 5 timer and we want to stop the second one(or update it), how to do that st

In Android, after starting any timer using TIMER or CountDownTimer, is there any way to track them? For example, if we start 5 timer and we want to stop the second one(or update it), how to do that stuff? Thanks in ad开发者_StackOverflow中文版vance.


put all of them in a list, set timer's tag an id (id from the list) and set listener. so when any of the timers are ticking or finish, you will be notified and you can identify them by id from the tag

0

精彩评论

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