My app occasionally reads text data from the clipboard. I'm using code like this, which seems to work ok on android.
String pasteText = null;
Object pasteObj = Display.getInstance()
.getPasteDataFromClipboard();
if (pasteObj instanceof CharSequence) {
pasteText = pasteObj.toString();
}
I'm wondering whether I am correct to use CharSequence
, rather than String
? String
would seem the intuitive choice, but didn't work for me when I tried it.
(I haven't tried the code on iOS. Haven't yet signed up as a developer on Apple.)