如何取消handler.postDelayed? [英] How to cancel handler.postDelayed?
本文介绍了如何取消handler.postDelayed?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我有 handler.postDelayed
已经在执行,我需要取消它的线程?
What if I have handler.postDelayed
thread already under execution and I need to cancel it?
推荐答案
我这样做是为了取消postDelays,每个Android的:<一href="http://developer.android.com/reference/android/os/Handler.html#removeCallbacks%28java.lang.Runnable%29">removeCallbacks消除了Runnable为r的任何未决的职位是在消息队列中。
I do this to cancel postDelays, per the Android: removeCallbacks removes any pending posts of Runnable r that are in the message queue.
handler.removeCallbacks(runnableRunner);
这篇关于如何取消handler.postDelayed?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文