Skip to content

Instantly share code, notes, and snippets.

@VassilisPallas
Created May 9, 2016 19:27
Show Gist options
  • Save VassilisPallas/65ef509592f06baad929a9e058e31dae to your computer and use it in GitHub Desktop.
Save VassilisPallas/65ef509592f06baad929a9e058e31dae to your computer and use it in GitHub Desktop.
copy selected text from Edittext on Android
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