schedule a timer task Interval - Android java.util

Android examples for java.util:Timer

Description

schedule a timer task Interval

Demo Code

import java.util.Timer;
import java.util.TimerTask;

public class Main {

  public static Timer scheduleInterval(int msec, TimerTask timerTask) {
    Timer timer = new Timer();
    timer.schedule(timerTask, 0, msec);//from w  ww .  j a va2 s  . com
    return timer;
  }

}

Related Tutorials