Example usage for android.content ClipData newIntent

List of usage examples for android.content ClipData newIntent

Introduction

In this page you can find the example usage for android.content ClipData newIntent.

Prototype

static public ClipData newIntent(CharSequence label, Intent intent) 

Source Link

Document

Create a new ClipData holding an Intent with MIME type ClipDescription#MIMETYPE_TEXT_INTENT .

Usage

From source file:Main.java

/**
 * Copy intent to Clipboard/*www. ja va  2  s  .c om*/
 *
 * @param context
 * @param intent
 */
public static void copy(Context context, Intent intent) {
    ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
    clipboard.setPrimaryClip(ClipData.newIntent(null, intent));
}