Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; public class Main { public static void putString(Context context, String string) { ClipboardManager manager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); manager.setPrimaryClip(ClipData.newPlainText("text", string)); } }