My application sometimes reads text data from the clipboard. I am using code like this that seems to work fine on android.
String pasteText = null;
Object pasteObj = Display.getInstance()
.getPasteDataFromClipboard();
if (pasteObj instanceof CharSequence) {
pasteText = pasteObj.toString();
}
I am wondering if it is right to use CharSequence
, not String
? String
would seem like an intuitive choice, but didn't work for me when I tried it.
(I have not tried the code on iOS. Not yet registered as a developer on Apple.)
source
share