所以,我创建了一个创建按钮,会弹出单选按钮项目警报对话框有5个,10个,15分钟,当我选择的项目countdowntimer将开始根据所选择的分钟,我现在的问题是如何用另一个按钮停止计时器。的Android - CountDownTimer上DialogFragment
,所以我有2类:
Start.java
public class Start extends DialogFragments{
CountDownTimer timer1;
//The rest of the code
}
Stop.java
public class Stop extends DialogFragments{
@onCreateDialog
AlertDialog ........
@setPositive.......
// here I want to call the timer to be cancel;
}
林在Android的环境新的,所以我想取消/当我停止计时器在停止片段alertdialog点击OK
发布一些代码会更好,这样我们就可以看到你迄今为止做了什么。无论如何,你可以调用yourTimer.cancel();停止倒数计时器。 – drWisdom