get Clipboard - Android Android OS

Android examples for Android OS:Clipboard

Description

get Clipboard

Demo Code


//package com.java2s;
import android.content.Context;

public class Main {
    @SuppressWarnings("deprecation")
    public static String getClipboard(Context context) {
        android.text.ClipboardManager clipboard = (android.text.ClipboardManager) context
                .getSystemService(Context.CLIPBOARD_SERVICE);
        return clipboard.getText().toString();
    }/*ww w.  j a  v a  2  s  .  co m*/
}

Related Tutorials