jonathan wrote:
> I need to display two timers on my app, I have two approaches, one is
> to implement the displays as TextView and then use java.util.Timer and
> TimerTask to update its text, however, the text doesn't redraw itself
> after update.

You can use Handler#postDelayed() or View#postDelayed() to arrange to
have work done on the UI thread after a period of time. Those, like your
Timer implementation, will suffer some amount of drift over a long
period. If you need greater precision, consider using AlarmManager.

What you definitely want to do is ensure you are updating your TextView
on the UI thread; otherwise, you will get exceptions.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, $35/Year

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to