CopyPastor

Detecting plagiarism made easy.

Score: 1.6681337356567383; Reported for: String similarity, Exact paragraph match Open both answers

Possible Plagiarism

Plagiarized on 2019-10-16
by Pradeep Kumar

Original Post

Original - Posted on 2013-10-08
by stinepike



            
Present in both answers; Present only in the new answer; Present only in the old answer;

use this method:
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); ClipData clip = ClipData.newPlainText(label, text); clipboard.setPrimaryClip(clip);
at the place of setPrimaryClip we can also use the following methods:
void clearPrimaryClip()
Clears any current primary clip on the clipboard.
ClipData getPrimaryClip()
Returns the current primary clip on the clipboard.
ClipDescription getPrimaryClipDescription()
Returns a description of the current primary clip on the clipboard but not a copy of its data.
CharSequence getText()
This method is deprecated. Use getPrimaryClip() instead. This retrieves the primary clip and tries to coerce it to a string.
boolean hasPrimaryClip()
Returns true if there is currently a primary clip on the clipboard.
use [ClipboardManager][1]
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); ClipData clip = ClipData.newPlainText(label, text); clipboard.setPrimaryClip(clip);
make sure you have imported `android.content.ClipboardManager` and NOT `android.text.ClipboardManager`. Latter is deprecated. Check this [link][2] for Further information.

[1]: http://developer.android.com/reference/android/content/ClipboardManager.html [2]: http://developer.android.com/reference/android/content/ClipData.html#newPlainText%28java.lang.CharSequence,%20java.lang.CharSequence%29

        
Present in both answers; Present only in the new answer; Present only in the old answer;