Sdílet prostřednictvím


View.StartDragAndDrop(ClipData, View+DragShadowBuilder, Object, Int32) Method

Definition

Starts a drag and drop operation.

[Android.Runtime.Register("startDragAndDrop", "(Landroid/content/ClipData;Landroid/view/View$DragShadowBuilder;Ljava/lang/Object;I)Z", "", ApiSince=24)]
public bool StartDragAndDrop (Android.Content.ClipData? data, Android.Views.View.DragShadowBuilder? shadowBuilder, Java.Lang.Object? myLocalState, int flags);
[<Android.Runtime.Register("startDragAndDrop", "(Landroid/content/ClipData;Landroid/view/View$DragShadowBuilder;Ljava/lang/Object;I)Z", "", ApiSince=24)>]
member this.StartDragAndDrop : Android.Content.ClipData * Android.Views.View.DragShadowBuilder * Java.Lang.Object * int -> bool

Parameters

data
ClipData

A android.content.ClipData object pointing to the data to be transferred by the drag and drop operation.

shadowBuilder
View.DragShadowBuilder

A android.view.View.DragShadowBuilder object for building the drag shadow.

myLocalState
Object

An java.lang.Object containing local data about the drag and drop operation. When dispatching drag events to views in the same activity this object will be available through android.view.DragEvent#getLocalState(). Views in other activities will not have access to this data (android.view.DragEvent#getLocalState() will return null). <p> myLocalState is a lightweight mechanism for the sending information from the dragged View to the target Views. For example, it can contain flags that differentiate between a a copy operation and a move operation. </p>

flags
Int32

Flags that control the drag and drop operation. This can be set to 0 for no flags, or any combination of the following: <ul> <li>#DRAG_FLAG_GLOBAL</li> <li>#DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION</li> <li>#DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION</li> <li>#DRAG_FLAG_GLOBAL_URI_READ</li> <li>#DRAG_FLAG_GLOBAL_URI_WRITE</li> <li>#DRAG_FLAG_OPAQUE</li> </ul>

Returns

true if the method completes successfully, or false if it fails anywhere. Returning false means the system was unable to do a drag because of another ongoing operation or some other reasons.

Attributes

Remarks

Java documentation for android.view.View.startDragAndDrop(android.content.ClipData, android.view.DragShadowBuilder, java.lang.Object, int).

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