Example usage for android.content ClipDescription getExtras

List of usage examples for android.content ClipDescription getExtras

Introduction

In this page you can find the example usage for android.content ClipDescription getExtras.

Prototype

public PersistableBundle getExtras() 

Source Link

Document

Retrieve extended data from the clip description.

Usage

From source file:com.example.android.droptarget.DropTargetFragment.java

/**
 * DragEvents can contain additional data packaged in a {@link PersistableBundle}.
 * Extract the extras from the event and return the String stored for the
 * {@link #EXTRA_IMAGE_INFO} entry./*  ww  w .java2 s .co  m*/
 */
private String getExtra(DragEvent event) {
    // The extras are contained in the ClipDescription in the DragEvent.
    ClipDescription clipDescription = event.getClipDescription();
    if (clipDescription != null) {
        PersistableBundle extras = clipDescription.getExtras();
        if (extras != null) {
            return extras.getString(EXTRA_IMAGE_INFO);
        }
    }
    return null;
}