我希望 AlertDialog 在 CountDownTimer 完成后显示,但是当我尝试执行此操作时出现错误。有没有人有解决方案或更好的方法?
{
new CountDownTimer(60000, 1000) {
public void onTick(long millisUntilFinished) {
mTextField.setText(":" + millisUntilFinished / 1000);
}
public void onFinish() {
mTextField.setText("GAME OVER");
mTextField.setTextSize(50);
AlertDialog.Builder ADB = new AlertDialog.Builder(getApplicationContext());
ADB.setTitle("GAME OVER")
.setMessage(R.string.app_name)
.setNeutralButton("PRESS BACK AND START GAME TO PLAY AGAIN", null)
.show();
}
}.start();
}