Skip to main content

Problem for AlertSetCmdLisListener test midlet on phoneme-feature-mr2

2 replies [Last post]
weamin
Offline
Joined: 2006-11-14
Points: 0

Running on phoneme-feature-mr1 and WTK22, it work fine.
But running on phoneme-feature-mr2, it will auto quit ?!
Is it a bug on phoneme-feature-mr2 ?

===========================================================
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class AlertSetCmdLisListener extends MIDlet
implements CommandListener {

Command exitCommand = new Command("Exit", Command.EXIT, 2);
Command okCommand = new Command("OK", Command.OK, 1);
Display display;
TextBox box;
Alert alert;
Displayable resumeScreen = null;

public AlertSetCmdLisListener() {
display = Display.getDisplay(this);

box = new TextBox("Box", "Click OK, alert display (timeout=5000)", 256, TextField.ANY);
box.addCommand(exitCommand);
box.addCommand(okCommand);
box.setCommandListener(this);

alert = new Alert("Alert", "After 5 seconds, This midlet will be destroyed.", null, AlertType.INFO);
alert.setTimeout(5000);
alert.setCommandListener(this);

resumeScreen = box;
}

public void startApp() {
display.setCurrent(resumeScreen);
}

public void pauseApp() {
resumeScreen = display.getCurrent();
}

public void destroyApp(boolean unconditional) {
}

public void commandAction(Command c, Displayable s) {
try {
if (c == exitCommand || c == Alert.DISMISS_COMMAND) {
destroyApp(false);
notifyDestroyed();
} else if (c == okCommand) {
display.setCurrent(alert, box);
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
===========================================================

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
olga_milovskaya
Offline
Joined: 2006-10-18
Points: 0

Hi weamin.

Unfortunately I can't reproduce you problem. Your MIDlet works fine on phoneme-feature-mr2. Could you get me know what platfor you use for the problem reproducing?

weamin
Offline
Joined: 2006-11-14
Points: 0

Hi,
I use the javacall-win32-x86 building.
Issue: "Don't click OK, wait after 5 sec, this midlet will auto destory ?!"