Skip to content

Instantly share code, notes, and snippets.

@MaartenS
Last active March 9, 2016 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaartenS/0ea266c7ba5028537329 to your computer and use it in GitHub Desktop.
Save MaartenS/0ea266c7ba5028537329 to your computer and use it in GitHub Desktop.
public class MyActivity extends Activity{

    private Handler mHandler = new Handler();

}
Timer timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {
  @Override
  public void run() {
      mHandler.post(new Runnable() {
           public void run() {
           // do UI stuff
           
           }
      });
  }
}, 5000, 3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment