None of the methods I found worked.
Here is what I tried :
1/ Using clearPrimaryClip()
method of ClipboardManager
class
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
clipboard.clearPrimaryClip();
This doesn't do anything. The clipboard still holds my old item.
2/ Using the suggestions from stackoverflow
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("label", " ");
clipboard.setPrimaryClip(clip);
This one only adds an empty clipboard item to the list of items. The old clipboard item is not cleared or removed.
Is there a programmatic way to delete an item from the clipboard item list?
Thanks.