4

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

flewby
  • 109
  • 8
  • I'm guessing that's correct but it might be something we would want to improve as this isn't very intuitive for most people. Can you please file an issue on this? – Shai Almog Nov 10 '17 at 04:56
  • I added a comment to the issue at [https://github.com/codenameone/CodenameOne/issues/1435](https://github.com/codenameone/CodenameOne/issues/1435) and linked back to this page. – flewby Nov 10 '17 at 19:37
  • @flewby Your link back to here is broken (its text is fine, but it links to elsewhere). – maaartinus Nov 10 '17 at 19:42

1 Answers1

0

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

Shai Almog
  • 51,749
  • 5
  • 35
  • 65