Search code examples
androidtimercountdown

Know Active Timer


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 advance.


Solution

  • 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