//run Runnable every 100ms private Handler handler = new Handler(); handler.postDelayed(runnable, 100); private Runnable runnable = new Runnable() { @Override public void run() { /* do what you need to do */ foobar(); /* and here comes the "trick" */ handler.postDelayed(this, 100); } }; Android Timer Java Android handle Timer Well, after programming a while for Android I got in touch with some things that are different from usual Java. I already mentioned that before, when I decided to start writing about my experiences with Android: Android & Memory (Leaks) ;) This time I’d like to write a bit about Timer and TimerTask and why you shouldn’t use them… While coding for a project I noticed that updating the gui out of a TimerTask didn’t work everytime and specially didn’t work good. Actually it basically never worked and at first I just could...
Free Online Resources and Information Technology