Compartilhar via


DragEvent.Result Property

Definition

Returns an indication of the result of the drag and drop operation.

public virtual bool Result { [Android.Runtime.Register("getResult", "()Z", "GetGetResultHandler")] get; }
[<get: Android.Runtime.Register("getResult", "()Z", "GetGetResultHandler")>]
member this.Result : bool

Property Value

true if a drag event listener returned true in response to #ACTION_DROP. If the system did not send #ACTION_DROP before #ACTION_DRAG_ENDED, or if the listener returned false in response to #ACTION_DROP, then false is returned.

Attributes

Remarks

Returns an indication of the result of the drag and drop operation. This method only returns valid data if the action type is #ACTION_DRAG_ENDED. The return value depends on what happens after the user releases the drag shadow.

If the user releases the drag shadow on a View that can accept a drop, the system sends an #ACTION_DROP event to the View object's drag event listener. If the listener returns true, then getResult() will return true. If the listener returns false, then getResult() returns false.

Notice that getResult() also returns false if no #ACTION_DROP is sent. This happens, for example, when the user releases the drag shadow over an area outside of the application. In this case, the system sends out #ACTION_DRAG_ENDED for the current operation, but never sends out #ACTION_DROP.

Java documentation for android.view.DragEvent.getResult().

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