Code:
// Get an instance of the UiEngine and place a Dialog in the queue
// to alert the user of the message in the String data.
public static void showMessage(String message)
{
StringBuffer sb = new StringBuffer("MyApp:");
sb.append(":\n");
sb.append(message);
Dialog dialog = new Dialog( Dialog.D_OK, sb.toString(), Dialog.OK,
Bitmap.getPredefinedBitmap(Bitmap.INFORMATION),
Manager.VERTICAL_SCROLL);
synchronized(Application.getEventLock())
{
Ui.getUiEngine().pushGlobalScreen(dialog, 1, UiEngine.GLOBAL_QUEUE);
}
}
change UiEngine.GLOBAL_QUEUE to UiEngine.GLOBAL_MODAL and the dialog will block your thread until its closed