Android Clipboard Copy onCopy(Context context, String content)

Here you can find the source of onCopy(Context context, String content)

Description

on Copy

Declaration

public static void onCopy(Context context, String content) 

Method Source Code

//package com.java2s;

import android.content.Context;

import android.text.ClipboardManager;

public class Main {
    public static void onCopy(Context context, String content) {
        ClipboardManager cmb = (ClipboardManager) context
                .getSystemService(Context.CLIPBOARD_SERVICE);
        cmb.setText(content.trim());//from  w  w  w  .j  ava  2 s  .  c  o m
    }
}

Related

  1. copyToClipboard(Context context, String label, String string, int toastMessageId)
  2. copyToClipboard(Context context, String lable, String text)
  3. copyToClipboard(Context context, String lable, String text)
  4. set(Context context, String value)