Here you can find the source of setClipboard(Context context, String text)
@SuppressWarnings("deprecation") public static boolean setClipboard(Context context, String text)
//package com.java2s; import android.content.Context; public class Main { @SuppressWarnings("deprecation") public static boolean setClipboard(Context context, String text) { android.text.ClipboardManager clipboard = (android.text.ClipboardManager) context .getSystemService(Context.CLIPBOARD_SERVICE); clipboard.setText(text);/*from www.ja va 2s. co m*/ return true; } }