Android examples for android.content:Clipboard
get Item Count in Clipboard
import android.annotation.TargetApi; import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; import android.os.Build; public class Main{ @TargetApi(Build.VERSION_CODES.HONEYCOMB) public static int getItemCount(Context context) { ClipboardManager clipboard = (ClipboardManager) context .getSystemService(Context.CLIPBOARD_SERVICE); ClipData data = clipboard.getPrimaryClip(); return data.getItemCount(); }/*w w w . jav a2 s.co m*/ }