Hi
I have an app which extends Application - in other words, it has no UI.
If it fails, I need to display a dialog to the user before quitting. So I use the following code:
Code:
public void message(String text)
{
synchronized(Application.getEventLock())
{
UiEngine ui = Ui.getUiEngine();
Screen screen = new Dialog(Dialog.D_OK, text, Dialog.OK,
Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION),
Manager.VERTICAL_SCROLL);
ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_QUEUE);
}
} The problem is, if I do:
Code:
message("Error - exiting application");
System.exit(1); ...the dialog box flashes up and disappears. I guess this is because there is no app owning the dialog.
Is there a way to wait until OK has been pressed before exiting?
Thanks
Simon