I want to exit the program after showing the alert.
So I display the alert and call notifyDestroyed()
display.setCurrent(alert)
alert.setTimeout(Alert.FOREVER);
notifyDestroyed();
But the program exit without showing the alert.
So I write the following way.
Is there any better way?
Code:alert=new Alert("","***********************",null,AlertType.ALARM); display.setCurrent(alert); alert.setTimeout(Alert.FOREVER); cmdExit=new Command("Exit",Command.EXIT,0); alert.addCommand(cmdExit); alert.setCommandListener(this); } else display.setCurrent(mainform); } public void commandAction(Command c, Displayable d) { notifyDestroyed(); }

Reply With Quote



