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


Blackberry Advertising Banner Vinyl Mesh Sign Fruit Vegetable Berry Farm Fresh picture

Blackberry Advertising Banner Vinyl Mesh Sign Fruit Vegetable Berry Farm Fresh

$179.95



FARM FRESH BLACKBERRIES CLEARANCE BANNER Advertising Vinyl Flag Sign AAA picture

FARM FRESH BLACKBERRIES CLEARANCE BANNER Advertising Vinyl Flag Sign AAA

$168.54



Little Trees 67343 Blackberry Clove Hanging Air Freshener for Car/Home 6 Pack picture

Little Trees 67343 Blackberry Clove Hanging Air Freshener for Car/Home 6 Pack

$8.99



Vintage RIM Blackberry R957M-2-5 with Belt Clip picture

Vintage RIM Blackberry R957M-2-5 with Belt Clip

$17.99



SFT DONGLE for Samsung Xiaomi Blackberry Sony SMART FLASHER TOOL NEW picture

SFT DONGLE for Samsung Xiaomi Blackberry Sony SMART FLASHER TOOL NEW

$155.72



BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL picture

BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL

$118.19







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