There are two sample applications. One is an example for sending an object by a dragging operation, and the other an example for receiving an object by a dropping operation. This sample application shows you how to enable the Dual window and how to implement an object interaction between Split windows on both the sender and receiver sides.


UI Introduction

The sample application has the following UI:


Function Introduction

Sender app example

When the user long presses an object and drags it, the application starts a drag operation and creates the ClipData from the dragged view. It can also create the drag shadow and display it.
There are two type of objects, one is plain text and the other one is an image to represent the URI. For the image, this application shows the dialog box to show a notification on the SAF (Storage Access Framework) of Android KitKat instead of performing an actual drag operation.

Receiver app example

When the user drops the text from the other Split window on the button, the button’s text changes to the same string of the dragged View text. This is done by getting the copied string from ClipData.
When the user drops the image from the other Split window on the ImageView, the ImageView’s image is changed into the same image of the dragged View. It is done by getting the copied URI value from ClipData and then getting the same image from same URI.