Teanga

View.RemoveCallbacks Method

Definition

Overloads

Name Description
RemoveCallbacks(IRunnable)

Removes the specified Runnable from the message queue.

RemoveCallbacks(Action)

Attempts to remove a pending execution of the specified action that was posted with Post(Action) or PostDelayed(Action, Int64).

RemoveCallbacks(IRunnable)

Removes the specified Runnable from the message queue.

[Android.Runtime.Register("removeCallbacks", "(Ljava/lang/Runnable;)Z", "GetRemoveCallbacks_Ljava_lang_Runnable_Handler")]
public virtual bool RemoveCallbacks(Java.Lang.IRunnable? action);
[<Android.Runtime.Register("removeCallbacks", "(Ljava/lang/Runnable;)Z", "GetRemoveCallbacks_Ljava_lang_Runnable_Handler")>]
abstract member RemoveCallbacks : Java.Lang.IRunnable -> bool
override this.RemoveCallbacks : Java.Lang.IRunnable -> bool

Parameters

action
IRunnable

The Runnable to remove from the message handling queue

Returns

true if this view could ask the Handler to remove the Runnable, false otherwise. When the returned value is true, the Runnable may or may not have been actually removed from the message queue (for instance, if the Runnable was not in the queue already.)

Attributes

Remarks

Removes the specified Runnable from the message queue.

Java documentation for android.view.View.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.

See also

  • Post(IRunnable)
  • <xref:Android.Views.View.PostDelayed(Java.Lang.IRunnable%2c+System.Int64)>
  • PostOnAnimation(IRunnable)
  • <xref:Android.Views.View.PostOnAnimationDelayed(Java.Lang.IRunnable%2c+System.Int64)>

Applies to

RemoveCallbacks(Action)

Attempts to remove a pending execution of the specified action that was posted with Post(Action) or PostDelayed(Action, Int64).

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

Parameters

action
Action

The action to remove from the message handling queue

Returns

false if no managed wrapper is currently registered for this action delegate instance; nothing is removed in that case, even if a post of the action is still pending. Otherwise true: the wrapper created by the most recent post of action is removed from the pending queue of the view and, if the view is attached to a window, from the message queue. A result of true does not mean that the action was still pending. Only one wrapper is tracked per delegate instance, and that registration is cleared whenever any posted execution of the action finishes running. Earlier posts are therefore never removed, and the most recent post is not removed if another execution of the action finished after it was posted (for example, an action that posts itself again). To cancel repeated work reliably, post one IRunnable instance (for example, a Runnable) and pass that same instance to RemoveCallbacks(IRunnable), or check a cancellation flag inside the action.

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