1 2 3 4 5 | public TimerTask myTimer = new TimerTask() { public void run() { Log.d( "neo" , "run timer" ); } }; |
1 2 | 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.
'프로그래밍 > Android' 카테고리의 다른 글
[Android] 네트워크 연결 상태 및 3G/WIFI 연결상태 체크하기 (0) | 2011.02.12 |
---|---|
[Android] Data exceeds UNCOMPRESS_DATA_MAX 에러 관련 (1) | 2011.01.07 |
[Android] java.io.IOException: Unable to upload file: null 오류 발생시 (0) | 2010.12.28 |
[Android] Landscape / Portrait 모드 지정 (0) | 2010.12.06 |
[Android]에뮬레이터 한글자판 설정 (0) | 2010.11.10 |