取消安卓CountDownTimer

取消安卓CountDownTimer

本文介绍了如何停止/取消安卓CountDownTimer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我扩展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.

这篇关于如何停止/取消安卓CountDownTimer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 05:22