title: Restart Countdown Timer with new time android
body: <p>I want to restart countdown timer with new time when countdown timer finishes. I am giving code below:          </p>
  
  <pre><code>futureInMillis = newTime();
  
              CountDownTimer remainingTimeCounter = new CountDownTimer(futureInMillis, 1000) {
  
              public void onTick(long millisUntilFinished) {
                  remainingTime = calculateRemainingTime(millisUntilFinished / 1000);
                  runOnUiThread(updateTime);
              }
  
              public void onFinish() {
                  // TODO: restart counter
                  cancel();
                  futureInMillis = newTime();
  //              remainingTimeCounter = null;
                  this.start();
              }
          }.start();
  </code></pre>