我正在倒计时。在“ 3-2-1”之后,我想查看正确的倒数计时器,该计时器显示了我设置的时间。
有人知道为什么该应用在“ 3-2-1”之后停止吗?
new CountDownTimer(4000, 1000) {
public void onTick(long millisUntilFinished) {
tv2.setText("Przygotuj się:\n " + millisUntilFinished / 1000);
}
public void onFinish() {
final java.util.Random rand = java.util.concurrent.ThreadLocalRandom.current();
new java.util.Timer().scheduleAtFixedRate(new java.util.TimerTask() {
@Override
public void run() {
new CountDownTimer(3000,1000){
@Override
public void onTick(long millisUntilFinished) {
tv2.setText("xd"+millisUntilFinished/1000);
}
@Override
public void onFinish() {
tv2.setText("haha");
}
}.start();
tv3.setText(kombinacje[r.nextInt(kombinacje.length)]);
}
}, 0, 3000);
MediaPlayer ring = MediaPlayer.create(Main6Activity.this, R.raw.ring1);
ring.start()
}
}.start();
}
}