17
我需要一個計時器用於我的程序。我寫了它,它在emulalator程序(Android 1.5/2.2)中的PC上運行良好。但它不適用於真正的設備(Android 1.5)。我究竟做錯了什麼?Android中的Timer和TimerTask
TimerTask task = new TimerTask() {
public void run() {
if (condition) {
myFunc();
} else {
this.cancel();
}
}
};
Timer timer = new Timer();
timer.schedule(task, 500, 85);
可能重複的[Android - 使用Timer和TimerTask控制任務?](http://stackoverflow.com/questions/2161750/android-controlling-a-task-with-timer-and-timertask) –
Go through這[android-controlling-a-task-with-timer-and-timertask](http://stackoverflow.com/questions/2161750/android-controlling-a-task-with-timer-and-timertask) – Rasel