My CountDown timer don't show 00 : 00

I'm creating a countDown app but the problem is when my CD timer reaches 00: 01 I think he skips the last onTick() here is my coed

public void buttonClicked(View view)
    {
        CountDownTimer countDown = new CountDownTimer(timerSeek.getProgress() * 1000 + 100, 1000) {
            @Override            public void onTick(long millisUntilFinished) {
                timerUpdate((int) millisUntilFinished / 1000);            }
            @Override            public void onFinish() {
                Toast.makeText(MainActivity.this, "finish", Toast.LENGTH_SHORT).show();            }
        }.start();    }

public void timerUpdate(int secondsLeft)
    {
        int minutes = secondsLeft / 60;        int seconds = secondsLeft - (minutes * 60);            String secondsStr = Integer.toString(seconds);            if (seconds < 10)
                secondsStr = "0" + secondsStr;        timerText.setText(Integer.toString(minutes) + " : " + secondsStr);    }

Answers 0

Related Articles