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