Android Utililty Methods Clipboard Read

List of utility methods to do Clipboard Read

Description

The list of methods to do Clipboard Read are organized into topic(s).

Method

StringreadFromClipboard(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();
...
StringreadFromClipboard(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();
...