How to copy text using ClipboardManager in Android

0

Looking for how to copy text in my app and paste it in a different app in android?

Answered question
0
public static void copyTextToClipBoard(Context context, String copiedText){
        ClipboardManager clickBoard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
        ClipData myClip = ClipData.newPlainText("text", copiedText);
        clickBoard.setPrimaryClip(myClip);
    }
Answered question
You are viewing 1 out of 1 answers, click here to view all answers.