List of utility methods to do Clipboard Read
String | readFromClipboard(Context context) read From Clipboard ClipboardManager clipboard = (ClipboardManager) context .getSystemService(Context.CLIPBOARD_SERVICE); ClipData clip = clipboard.getPrimaryClip(); if (clip != null) { ClipData.Item item = clip.getItemAt(0); CharSequence text = item.getText(); if (text != null && text.length() > 0) { return text.toString(); ... |
String | readFromClipboard(Context context) Get text from the clipboard. ClipboardManager clipboard = (ClipboardManager) context .getSystemService(Context.CLIPBOARD_SERVICE); ClipData clip = clipboard.getPrimaryClip(); if (clip != null) { ClipData.Item item = clip.getItemAt(0); CharSequence text = item.getText(); if (text != null && text.length() > 0) { return text.toString(); ... |