Java tutorial
//package com.java2s; import android.content.ClipData; import android.content.Context; import android.content.ClipboardManager; public class Main { public static void putTextIntoClipboard(Context context, String text) { ClipboardManager clipboardManager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); ClipData clipData = ClipData.newPlainText("copy text", text); clipboardManager.setPrimaryClip(clipData); } }