View.RemoveCallbacks Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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, the result of passing the registered wrapper to RemoveCallbacks(IRunnable). A result of true does not mean that a pending callback was removed. Only the most recently registered wrapper is tracked for a delegate instance, including wrappers registered by other views or for drawable scheduling. When a wrapper executes normally, it clears the registration even if a newer wrapper replaced it. Pending callbacks can therefore become unavailable to this overload. 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.