因此,我大米在我的J2ME申请中增加了一个表格,但在试图回到主屏幕上时,总是得到一个无名的例外。 当我用一枚血管,我能够成功地回到主菜园时,这似乎不会发生。 什么?
表格从主要中点开始
quickAlarm = new QuickAlarm("Set quick alarm",this);
display.setCurrent(quickAlarm);
快速反应部队
public QuickAlarm(String title,HelloMIDlet midlet) {
super(title);
df = new DateField("Alarm time",DateField.TIME);
this.append(df);
this.midlet = midlet;
backCommand = new Command("Back",Command.BACK,0);
saveCommand = new Command("Save",Command.OK,1);
this.addCommand(backCommand);
this.addCommand(saveCommand);
}
从QuickAlarm返回主菜,
this.midlet.leaveCanvas();
这是主要的中点。
public void leaveCanvas() {
display.setCurrent(startOptions);
}
完全错误是
TRACE: <at java.lang.NullPointerException: 0>, Exception caught in Display class
java.lang.NullPointerException: 0
at javax.microedition.lcdui.Display$ChameleonTunnel.callScreenListener(), bci=46
at com.sun.midp.chameleon.layers.SoftButtonLayer.processCommand(), bci=74
at com.sun.midp.chameleon.layers.SoftButtonLayer.soft1(), bci=37
at com.sun.midp.chameleon.layers.SoftButtonLayer.keyInput(), bci=36
at com.sun.midp.chameleon.CWindow.keyInput(), bci=38
at javax.microedition.lcdui.Display$DisplayEventConsumerImpl.handleKeyEvent(), bci=17
at com.sun.midp.lcdui.DisplayEventListener.process(), bci=277
at com.sun.midp.events.EventQueue.run(), bci=179
at java.lang.Thread.run(Thread.java:637)