다음을 통해 공유


View.DispatchDragEvent(DragEvent) Method

Definition

Detects if this View is enabled and has a drag event listener.

[Android.Runtime.Register("dispatchDragEvent", "(Landroid/view/DragEvent;)Z", "GetDispatchDragEvent_Landroid_view_DragEvent_Handler")]
public virtual bool DispatchDragEvent (Android.Views.DragEvent? e);
[<Android.Runtime.Register("dispatchDragEvent", "(Landroid/view/DragEvent;)Z", "GetDispatchDragEvent_Landroid_view_DragEvent_Handler")>]
abstract member DispatchDragEvent : Android.Views.DragEvent -> bool
override this.DispatchDragEvent : Android.Views.DragEvent -> bool

Parameters

Returns

Attributes

Remarks

Detects if this View is enabled and has a drag event listener. If both are true, then it calls the drag event listener with the android.view.DragEvent it received. If the drag event listener returns true, then dispatchDragEvent() returns true.

For all other cases, the method calls the android.view.View#onDragEvent(DragEvent) onDragEvent() drag event handler method and returns its result.

This ensures that a drag event is always consumed, even if the View does not have a drag event listener. However, if the View has a listener and the listener returns true, then onDragEvent() is not called.

Java documentation for android.view.View.dispatchDragEvent(android.view.DragEvent).

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