01-24-2013 07:59 AM - edited 01-24-2013 08:00 AM
remote the invokeandwait, with uiengine you don't need to synchronize on the event thread.
edit:
if you want the dialog to block use pushModalScreen
01-25-2013 01:10 AM - edited 01-25-2013 01:11 AM
Thank you Simon. Can you please tell me how I can remote the invokeAnd Wait() ? I didn't synchronize the event thread now, but its not showing any dialog box on my application startup. My code below:
Application.getApplication().invokeAndWait(new Runnable(){
public void run() {
//with this UiEngine I'm able to pushGlobal dialogs
UiEngine ui = Ui.getUiEngine();
Screen screen = new Dialog(Dialog.D_OK, "View permissions, click on Menu button and Click on Save", Dialog.OK, Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION), Manager.VERTICAL_SCROLL);
ui.pushModalScreen(screen);
MyBackgroundScreen.scr.invalidate(); //scr is my screen object
}
});
Can you please check again?
01-25-2013 03:00 AM
01-25-2013 07:38 AM
Okay, my code now is:
UiEngine ui = Ui.getUiEngine();
Screen screen = new Dialog(Dialog.D_OK, "View permissions, click on Menu button and Click on Save", Dialog.OK, Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION), Manager.VERTICAL_SCROLL);
ui.pushModalScreen(screen);
ShotUpScreen.scr.invalidate();
//invoke permissions
But its still not showing any pop ups.
01-29-2013 12:25 AM
Please help me simon_hain .
01-29-2013 07:13 AM
01-30-2013 12:57 AM - edited 01-30-2013 12:58 AM
You mean like this:
private void setPermissions(){
UiEngine ui = Ui.getUiEngine();
Screen screen = new Dialog(Dialog.D_OK, "View permissions, click on Menu button and Click on Save", Dialog.OK, Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION), Manager.VERTICAL_SCROLL);
ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_QUEUE);
MyBackgroundScreen.scr.invalidate();
//invoke permissions
}
But it still hangs/blocks my device screen. What do I do now?
01-30-2013 02:52 AM
01-30-2013 03:20 AM
I mean when I install my application, my device hangs. I see the cropped image of "Downloading MyBackgroundApp"..