Countdown timer with pause and resume

android

Solution

in onTick method..save the milliseconds left

   long s1=millisUntilFinished;

when you want to pause the timer use..

   Counter.cancel();

when you want to resume create a new countdowntimer with left milliseconds..

 timervalue=s1
  counter= new Counter1();
   counter.start();

See this link

Problem

I want to do countdown timer with pause and restart.Now i am displaying countdown timer By implenting ontick() and onfinish().please help me out.HEre is th code for countdown timer ``` final CountDownTimer Counter1 = new CountDownTimer(timervalue1 , 1000) { public void onTick(long millisUntilFinished) { System.out.println("onTick method!"(String.valueOf(millisUntilFinished/1000)));long s1=millisUntilFinished; } public void onFinish() { System.out.println("Finished!"); } } ```

Original source

Related problems