java - Pros and cons of using a Thread or TimerTask for an Android game -


many android game examples utilize thread run game engine on particular interval. however, i've seen other examples use timertask run game engine interval well. i'm curious other developers think pros , cons of each approach are.

timertask wrapper thread provides callback main thread allows schedule running of runnable sometime in future. have different use cases. if need run code now, use thread, if need schedule run in future, use timertask.

edit: mistake, thinking of different class. fixed


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -