2016-07-22 59 views

回答

2

嘗試這樣

void TimerTask(int count) 
    { 
     if(count>8) // 8 cyclses,because 60*2/15 
      return; 

     Timer myTimer = new Timer(); // Create timer 
     myTimer.schedule(new TimerTask() { 
      @Override 
      public void run() { 
       // run your async task there 

       TimerTask(count++); //OnExecute 

      } 
     }, 0L, 15L * 1000);//every 15 sec (0L - seconds waiting for start) 
    } 

` 稱之爲 - 的TimerTask(0);

+0

另一個計時器的意思是?傢伙請給我詳細信息 –

+0

謝謝你很多! –

+0

我需要修改小的東西,如果我的狀態'00',直到2 minuts我需要逃離時間,如何做到這一點? –

相關問題