Code example for ClipData

Methods: getItemAt

        public void onPrimaryClipChanged() { 
            Log.d(TAG, "onPrimaryClipChanged"); 
            ClipData clip = mClipboardManager.getPrimaryClip(); 
            mThreadPool.execute(new WriteHistoryRunnable( 
    private class WriteHistoryRunnable implements Runnable {
        private final Date mNow;
        private final CharSequence mTextToWrite;
        public WriteHistoryRunnable(CharSequence text) {
            mNow = new Date(System.currentTimeMillis());
            mTextToWrite = text;
        public void run() { 
Connect your IDE to all the code out there  Get Codota for Java