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