clipboard Copy Text - Android android.content

Android examples for android.content:Clipboard

Description

clipboard Copy Text

Demo Code

import android.content.Context;
import android.text.ClipboardManager;

public class Main{

    public static final void clipboardCopyText(Context context,
            CharSequence text) {//www . j av  a  2  s.  c  om
        ClipboardManager cm = (ClipboardManager) context
                .getSystemService(Context.CLIPBOARD_SERVICE);
        if (cm != null) {
            cm.setText(text);
        }
    }

}

Related Tutorials