copy Text from Clipboard - Android Android OS

Android examples for Android OS:Clipboard

Description

copy Text from Clipboard

Demo Code


//package com.java2s;
import android.content.Context;

public class Main {
    @SuppressWarnings("deprecation")
    public static void copyText(Context context, String text) {
        android.text.ClipboardManager cm = (android.text.ClipboardManager) context
                .getSystemService(Context.CLIPBOARD_SERVICE);
        cm.setText(text);/*from  w w w  .ja v  a 2 s.c  om*/
    }
}

Related Tutorials