BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 01-14-2009, 04:55 AM   #1
blackharry
New Member
 
Join Date: Apr 2008
Model: 8310
PIN: N/A
Carrier: none
Posts: 13
Question Cannot exit midlet on Storm simulator

Please Login to Remove!

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!
Offline  
Old 01-14-2009, 05:07 AM   #2
blackharry
New Member
 
Join Date: Apr 2008
Model: 8310
PIN: N/A
Carrier: none
Posts: 13
Default

this midlet (not using the low level gui) works fine on standard j2me and BB!?
Code:
public class HelloStormMIDlet extends MIDlet implements CommandListener {

	Command exitCommand = null;

	protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
	}

	protected void pauseApp() {
	}

	protected void startApp() throws MIDletStateChangeException {
		Form form = new Form("HelloWorld");
		exitCommand = new Command("Exit", Command.EXIT, 1);
		form.addCommand(exitCommand);
		form.setCommandListener(this);
		Display.getDisplay(this).setCurrent(form);
	}

	public void commandAction(Command c, Displayable d) {
		if (c == exitCommand) {
			this.notifyDestroyed();
		}
	}
}
Offline  
Old 02-09-2009, 07:44 AM   #3
blackharry
New Member
 
Join Date: Apr 2008
Model: 8310
PIN: N/A
Carrier: none
Posts: 13
Default

did anybody ever write a j2me appliation for the storm?
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


MOSFET - IRFZ44N 55V - Transistor  for Arduino Pi  TTL picture

MOSFET - IRFZ44N 55V - Transistor for Arduino Pi TTL

$54.79



840PCS 24 Value TO-92 Transistor Assortment Kit Box NPN PNP 2N2222-S9018 / BC327 picture

840PCS 24 Value TO-92 Transistor Assortment Kit Box NPN PNP 2N2222-S9018 / BC327

$14.99



TO-92 Assortment NPN PNP DIY kit 15 value 600pcs Transistor  picture

TO-92 Assortment NPN PNP DIY kit 15 value 600pcs Transistor

$14.40



US Stock 4pcs 2N3055 NPN AF Amp Audio Power Transistor 15A/60V picture

US Stock 4pcs 2N3055 NPN AF Amp Audio Power Transistor 15A/60V

$11.66



MOSFET - IRF540N 100V 33A - Transistor for Arduino Pi TT picture

MOSFET - IRF540N 100V 33A - Transistor for Arduino Pi TT

$49.72



Portable 600pc 15Value NPN PNP Transistor TO-92 Assortment Kit Set /Box Hot picture

Portable 600pc 15Value NPN PNP Transistor TO-92 Assortment Kit Set /Box Hot

$12.66







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.