프로그래밍/Android

[Android] Timer 사용하기

암리타 2010. 12. 29. 18:28
public TimerTask myTimer = new TimerTask() {
	public void run() {
		Log.d("neo", "run timer");
	}
};

timer = new Timer();
timer.schedule(myTimer, 500, 1000);


public void schedule (TimerTask task, long delay, long period)

timer.schedule 설명
TimerTask : 작업할 내용
delay : 몇 ms 후에 호출할 것인지
period : 몇 ms 간격으로 호출한것인지

[원문]
task the task to schedule.
delay amount of time in milliseconds before first execution.
period amount of time in milliseconds between subsequent executions.