Handler.RemoveCallbacks Method

Definition

Overloads

Name Description
RemoveCallbacks(IRunnable, Object)

Remove any pending posts of Runnable <var>r</var> with Object <var>token</var> that are in the message queue.

RemoveCallbacks(Action, Object)

Removes pending callbacks for the specified runnable.

RemoveCallbacks(Action)

Removes pending callbacks for the specified runnable.

RemoveCallbacks(IRunnable)

Remove any pending posts of Runnable r that are in the message queue.

RemoveCallbacks(IRunnable, Object)

Remove any pending posts of Runnable <var>r</var> with Object <var>token</var> that are in the message queue.

[Android.Runtime.Register("removeCallbacks", "(Ljava/lang/Runnable;Ljava/lang/Object;)V", "")]
public void RemoveCallbacks(Java.Lang.IRunnable r, Java.Lang.Object? token);
[<Android.Runtime.Register("removeCallbacks", "(Ljava/lang/Runnable;Ljava/lang/Object;)V", "")>]
member this.RemoveCallbacks : Java.Lang.IRunnable * Java.Lang.Object -> unit

Parameters

r
IRunnable

The value cannot be null.

token
Object

The value may be null.

Attributes

Remarks

Remove any pending posts of Runnable <var>r</var> with Object <var>token</var> that are in the message queue. If <var>token</var> is null, all callbacks will be removed.

This operation is worst case O(n) in the number of messages in the queue, and should be avoided. Instead consider another mechanism outside of the queue to cancel a pending operation. For instance, maintain a flag to indicate whether the operation should be performed differently or not at all once it is dispatched.

Java documentation for android.os.Handler.removeCallbacks(java.lang.Runnable, java.lang.Object).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

RemoveCallbacks(Action, Object)

Removes pending callbacks for the specified runnable.

public void RemoveCallbacks(Action action, Java.Lang.Object token);
member this.RemoveCallbacks : Action * Java.Lang.Object -> unit

Parameters

action
Action

The runnable to execute.

token
Object

The token associated with the callback.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

RemoveCallbacks(Action)

Removes pending callbacks for the specified runnable.

public void RemoveCallbacks(Action action);
member this.RemoveCallbacks : Action -> unit

Parameters

action
Action

The runnable to execute.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

RemoveCallbacks(IRunnable)

Remove any pending posts of Runnable r that are in the message queue.

[Android.Runtime.Register("removeCallbacks", "(Ljava/lang/Runnable;)V", "")]
public void RemoveCallbacks(Java.Lang.IRunnable r);
[<Android.Runtime.Register("removeCallbacks", "(Ljava/lang/Runnable;)V", "")>]
member this.RemoveCallbacks : Java.Lang.IRunnable -> unit

Parameters

r
IRunnable

The value cannot be null.

Attributes

Remarks

Remove any pending posts of Runnable r that are in the message queue.

This operation is worst case O(n) in the number of messages in the queue, and should be avoided. Instead consider another mechanism outside of the queue to cancel a pending operation. For instance, maintain a flag to indicate whether the operation should be performed differently or not at all once it is dispatched.

Java documentation for android.os.Handler.removeCallbacks(java.lang.Runnable).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to