Can someone please show me, why the following midlet does not exit correctly on the storm simulator. When the touchscreen is pressed, the screen disappears and immediately returns.
On standard J2ME (without BB api) the midlet exits fine!?
Code:
public class CanvasMIDlet extends MIDlet {
public static CanvasMIDlet midlet = null;
public CanvasMIDlet() {
midlet = this;
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
}
protected void pauseApp() {
}
protected void startApp() throws MIDletStateChangeException {
Display.getDisplay(this).setCurrent(new MyCanvas());
}
public static void exitApp() {
midlet.notifyDestroyed();
}
private class MyCanvas extends Canvas {
protected void paint(Graphics g) {
g.setColor(0xffffff);
this.setFullScreenMode(true);
g.fillRect(0, 0, getWidth(), getHeight());
}
protected void pointerPressed(int x, int y) {
CanvasMIDlet.exitApp();
}
}
}
Thanks!