schedule a timer task After seconds - Android java.util

Android examples for java.util:Timer

Description

schedule a timer task After seconds

Demo Code

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

public class Main {

  public static Timer scheduleAfter(int msec, TimerTask timerTask) {
    Timer timer = new Timer();
    timer.schedule(timerTask, msec);//  ww w .  j  ava 2  s.  c  o  m
    return timer;
  }

}

Related Tutorials