这是一个倒数计时器,我想在几分钟和几秒钟内打印出来。ex(300000mili)5分钟,然后数4:60、4:59 ...这是我的代码的一部分
final MyCounter timer = new MyCounter(300000,1000);
blue.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
timer.start();
}
});
}
public class MyCounter extends CountDownTimer {
public MyCounter(long millisInFuture, long countDownInterval) {
super(millisInFuture, countDownInterval);
}
@Override
public void onFinish() {
blue.setText("Live");
}
@Override
public void onTick(long millisUntilFinished) {
blue.setText((millisUntilFinished/60000)+":"+(millisUntilFinished/5000));
// i tried this
}
}
当缺少20秒时,我该如何振动?何时完成?谢谢,抱歉我的英语不好
森林海