我怎样才能连续每5秒运行一次计时器。 下面是代码片段::
Timer timer;
TimerTask timerTask = new TimerTask() {
@Override
public void run() {
// TODO Auto-generated method stub
Log.d("adad","asdadsa");
}
};
timer.schedule(timerTask,0,5);
答案 0 :(得分:0)
Timer timer= new Timer();
TimerTask timerTask = new TimerTask() {
@Override
public void run() {
// TODO Auto-generated method stub
Log.d("adad","asdadsa");
}
};
timer.schedule(timerTask,0,5000);
一些小的改动检查它......