NullPointer exception for showForm()

21 views
Skip to first unread message

anop...@gmail.com

unread,
Feb 11, 2014, 9:06:38 AM2/11/14
to codenameone...@googlegroups.com
In the following code (J2ME platform):

CodeScanner.getInstance().scanQRCode(new ScanResult() {
public void scanCompleted(String contents, String formatName, byte[] rawBytes) {
Display.getInstance().callSerially(new Runnable() {
public void run() {
Log.p("scanCancelled-11-1");
showForm("Form1",null);
Log.p("scanCancelled-11-2");
}
});
}
}

When I reach the line showForm("Form1", null) I get a NullPointer exception. Keep in mind that the form Form1 exists in the .res file but has never been created/displayed till that moment.

If I replace the Form1 with another form that has already been created/displayed everything works fine.

How can I show a Form1 without getting the NullPointerException?

Shai Almog

unread,
Feb 11, 2014, 12:08:05 PM2/11/14
to codenameone...@googlegroups.com, anop...@gmail.com
I see an EDT violation in the port. I'll fix it for the next update.

anop...@gmail.com

unread,
Feb 12, 2014, 4:34:54 AM2/12/14
to codenameone...@googlegroups.com, anop...@gmail.com
Thanks Shai!
When is the next update going to take place?
To use the updated version do I have to update the CN1 Eclipse plugin?

Shai Almog

unread,
Feb 12, 2014, 12:34:25 PM2/12/14
to codenameone...@googlegroups.com, anop...@gmail.com
It should be up now, just send a build.
Reply all
Reply to author
Forward
0 new messages