Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 2
    I've read many posts about irregular behavior of TimerTasks. My advice would be steer clear of them and use the handler / postDelayed approach. Commented Dec 2, 2013 at 14:18
  • 1
    I'd prefer the Handler-postDelay method - you have more control and you schedule it from the inside Commented Dec 2, 2013 at 14:27
  • 1
    Here is a great source for Timer vs. Handler Commented Jan 13, 2015 at 14:20
  • TimerTask is a background-task, so you can not update UI. Just saying... Commented Mar 16, 2016 at 1:29
  • For the people reading this: @Yousha Aleayoub of course you can using the Handler. Commented Oct 15, 2019 at 13:33