计时器倒计时格式问题

时间:2015-06-10 00:43:16

标签: java timer countdown

我正在使用以下代码以“hh:mm:ss”格式显示计时器并从一天开始倒计时,但是我得到了这个输出。我该如何解决?

 new CountDownTimer(86400000, 1000) { // adjust the milli seconds here

        public void onTick(long millisUntilFinished) {
            _tv.setText(""+String.format("%d H, %d MIN, %d SEC",
                    TimeUnit.MILLISECONDS.toHours(millisUntilFinished),
                    TimeUnit.MILLISECONDS.toMinutes( millisUntilFinished),
                    TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished) -
                            TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished))));
        }

        public void onFinish() {
            _tv.setText("PLAY NOW!");
        }
    }.start();

enter image description here

0 个答案:

没有答案