As for using Timer, wouldn't that depend on what you are doing? The original post, to which that response was made, said "a function to be called every second."
Yes, Handler is what you want for updating the UI (and Diane knows better than just about anyone ;)), but I thought you wanted to do some other non UI task somewhere every second, and then reflect that something was happening in the UI - Timer comes in handy in some cases, though no, it should not be used just for updating a view. Or should it just be avoided in all cases (I have used it for non UI stuff and it seems to work fine)? On Oct 22, 10:16 pm, hackbod <[EMAIL PROTECTED]> wrote: > Please don't use java.util.Timer, use android.os.Handler instead, it > is much more efficient. > > On Oct 22, 6:05 am, Charlie Collins <[EMAIL PROTECTED]> wrote: > > > Android has java.util.Timer and > > related.http://code.google.com/android/reference/java/util/Timer.html > > > Use that on a background thread and call back into the UI via a > > Handler and Message. But be careful about updating every second, make > > sure you really need to do that. > > > On Oct 22, 3:36 am, "cH3Lu eu" <[EMAIL PROTECTED]> wrote: > > > > Hi All, > > > > Does anybody knows if I can register a function to be called at every > > > second > > > within an activity? if not, what do you suggest to do if I need a widget > > > to > > > refresh at every 1 second? > > > > Thanks a lot. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

