Getting repeat values after copying 2-3 items to clipboard in android?
Posted
by
Gurpreet singh
on Stack Overflow
See other posts from Stack Overflow
or by Gurpreet singh
Published on 2014-08-21T05:34:42Z
Indexed on
2014/08/22
10:20 UTC
Read the original article
Hit count: 217
I am using clipboard code like below in my app.Everything is working fine if i copy one item at a time.But when we copy 2-3 items one after other and paste somewhere it starts retrieving repeated past value from clipboard rather than the current value.After googling a lot i came to know that its a problem with Samsung phones and i need to clear clipboard history for that.But i could not find any way to clear clipboard history.
Public void CopyToClipboard {
int pos = (Integer) v.getTag();
StatusEntity obj=getItem(pos);
ClipboardManager clipmanager= (ClipboardManager)getContext().getSystemService(getContext().CLIPBOARD_SERVICE);
ClipData clip=ClipData.newPlainText("data",obj.getStatus());
clipmanager.setPrimaryClip(clip);
Toast.makeText(getContext(), "Copied to clipboard", 1000).show();
}
Hoping that anyone of you can help me regarding this .Any help would be appreciated.
© Stack Overflow or respective owner