如何停止/取消安卓CountDownTimerCountDownTimer

2023-09-12 03:35:49 作者:霸欲、天下

我扩展CountDownTimer类获得的情况下,一些条件得到满足我呼吁取消()一些自定义的功能。在onTick(),预计这将是它的结束,但是onTick()回调得到调用,直到在倒计时为止。那么如何发生prevent呢?

I'm extending the CountDownTimer class to obtain some custom functionality .In onTick() in case some conditions are met I call cancel() , expecting that will be the end of it, however the onTick() callback gets call until the the count down is reached . So how to prevent this from happening ?

推荐答案

CountDownTimer也正在对我很好,但我认为,如果你外线电话的CountDownTimer实现(它也只能说是不把它在onTick)。

CountDownTimer is also working fine for me, but I think it only works if you call it OUTSIDE of the CountDownTimer implemetation (that is don't call it in the onTick).

调用它里面也没有工作。

Calling it inside also didn't worked.