android 随手记 倒计时




class CountDownUtils extends CountDownTimer {

        public CountDownUtils(long millisInFuture, long countDownInterval) {
            super(millisInFuture, countDownInterval);

        }

        @Override
        public void onFinish() {
            Log.i("test", "结束倒计时");
            mHandler.sendEmptyMessage(4);
        }

        @Override
        public void onTick(long millisUntilFinished) {

        }
    }


CountDownUtils tmierutil;

private void mytimer() {
        tmierutil = new CountDownUtils(20000, 1000);
        tmierutil.start();
    }

原文地址:https://www.cnblogs.com/keanuyaoo/p/3271494.html