Here you can find the source of copyToClipboard(Context context, String lable, String text)
public static boolean copyToClipboard(Context context, String lable, String text)
//package com.java2s; import android.content.Context; public class Main { public static boolean copyToClipboard(Context context, String lable, String text) {/*w ww.j av a 2s.c om*/ try { android.content.ClipboardManager clipboard = (android.content.ClipboardManager) context .getSystemService(Context.CLIPBOARD_SERVICE); android.content.ClipData clip = android.content.ClipData .newPlainText(lable, text); clipboard.setPrimaryClip(clip); return true; } catch (Exception e) { return false; } } }