Question: What if I have `handler.postDelayed` thread already under execution and I need to cancel it?

Answer: 
I do this to cancel postDelays, per the Android: [removeCallbacks](http://developer.android.com/reference/android/os/Handler.html#removeCallbacks%28java.lang.Runnable%29) removes any pending posts of Runnable r that are in the message queue.

```
handler.removeCallbacks(runnableRunner);

```

or use to remove all messages and callbacks

```
handler.removeCallbacksAndMessages(null);

```
If you don't want to keep a reference of the runnable, you could simply call:

```
handler.removeCallbacksAndMessages(null);

```

[The official documentation](http://developer.android.com/reference/android/os/Handler.html#removeCallbacksAndMessages(java.lang.Object)) says:

> 
> ... If token is null, all callbacks and messages will be removed.
> 
> 
>