Android Clipboard Copy copyText(Context context, String text)

Here you can find the source of copyText(Context context, String text)

Description

copy Text

License

Open Source License

Declaration

public static void copyText(Context context, String text) 

Method Source Code

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

public class Main {

    public static void copyText(Context context, String text) {
        if (TextUtils.isEmpty(text)) {
            return;
        }/*from  w  ww  . ja  v a 2 s . c o m*/

        android.text.ClipboardManager clipboard = (android.text.ClipboardManager) context
                .getSystemService(Context.CLIPBOARD_SERVICE);
        clipboard.setText(text);

    }
}

Related

  1. setText(final Context context, final CharSequence text)
  2. setText(final Context context, final CharSequence text)
  3. copy(Context context, String content)
  4. copyText(Context context, String text)
  5. copyText(Context context, String text)