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?