How to read a String from the clipboard in a codename one app?

Viewed 88

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.)

1 Answers

That issue is currently assigned to the 4.0 milestone which is planned for March 2018 so this should be addressed before that.

Related