所以我試圖做一個「活飼料」本質上,我的代碼如下所示。基本上,我得到了「應用程序意外停止」錯誤,所以我調試了。當我調試時,它說「Timer.class不在android.jar中」。我知道我的refreshFeed()靜態方法工作得很好(沒有定時器測試它),所以它不能這樣。有什麼我在這裏失蹤?任何幫助是極大的讚賞!Timer和TimerTask問題:「Timer.class不在android.jar中」和「應用程序意外停止」?
Timer time = new Timer();
TimerTask refresh = new TimerTask(){
public void run(){
feedEntry.refreshFeed();
}
};
time.scheduleAtFixedRate(refresh, 0, 10000);
你正在使用哪個Timer類? – 2011-04-12 04:39:25
David我是和正在使用java.util的Timer類 – Vinay 2011-04-14 15:20:48