Android.Views.View.CancelPendingInputEvents Method
Cancel any deferred high-level input events that were previously posted to the event queue.

Syntax

[Android.Runtime.Register("cancelPendingInputEvents", "()V", "")]
public void CancelPendingInputEvents ()

Remarks

Cancel any deferred high-level input events that were previously posted to the event queue.

Many views post high-level events such as click handlers to the event queue to run deferred in order to preserve a desired user experience - clearing visible pressed states before executing, etc. This method will abort any events of this nature that are currently in flight.

Custom views that generate their own high-level deferred input events should override View.OnCancelPendingInputEvents and remove those pending events from the queue.

This will also cancel pending input events for any child views.

Note that this may not be sufficient as a debouncing strategy for clicks in all cases. This will not impact newer events posted after this call that may occur as a result of lower-level input events still waiting in the queue. If you are trying to prevent double-submitted events for the duration of some sort of asynchronous transaction you should also take other steps to protect against unexpected double inputs e.g. calling View.Enabled and re-enabling the view when the transaction completes, tracking already submitted transaction IDs, etc.

[Android Documentation]

Requirements

Namespace: Android.Views
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1