I have a Java application that is just supposed to put up a modal Alert and then exit when the exit button is clicked. Doesn't work on my Samsung 660 or the Sprint simulator. What am I doing wrong?
[code:1:a552cc0d8e]
package net.justthe.mobile;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class jtnAppMIDlet extends MIDlet implements CommandListener {
private Command exitCommand; // The exit command
private Display display; // The display for this MIDlet
public jtnAppMIDlet() {
display = Display.getDisplay(this);
exitCommand = new Command("Exit", Command.SCREEN, 2);
}
public void startApp() {
Alert t = new Alert("This is a test",
"Testing...",null,AlertType.INFO);
t.setTimeout(Alert.FOREVER);
t.addCommand(exitCommand);
t.setCommandListener(this);
display.setCurrent(t);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command c, Displayable s) {
if (c == exitCommand) {
destroyApp(false);
notifyDestroyed();
}
}
}
[/code:1:a552cc0d8e]
I'm new to J2ME programming and am sure I'm making an obvious mistake. It's just not obvious to me :)
Thanks in advance