Created
October 9, 2016 20:02
-
-
Save corlaez/aadd795922958f807a6eefbd1a504243 to your computer and use it in GitHub Desktop.
Copy to clipboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void copyToClipboard() { | |
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); | |
ClipData clip = ClipData.newPlainText(label, text); | |
clipboard.setPrimaryClip(clip); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment