Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
simon_hain
Posts: 16,004
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: How to show a message dialog when an app is installed?

[ Edited ]

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

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
nikita18
Posts: 144
Registered: ‎08-18-2012
My Device: Blackberry Curve 8520
My Carrier: Vodafone

Re: How to show a message dialog when an app is installed?

[ Edited ]

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? 

 

Please use plain text.
Developer
simon_hain
Posts: 16,004
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: How to show a message dialog when an app is installed?

in this code i still see invokeandwait, just remove it.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
nikita18
Posts: 144
Registered: ‎08-18-2012
My Device: Blackberry Curve 8520
My Carrier: Vodafone

Re: How to show a message dialog when an app is installed?

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.

 

Please use plain text.
Developer
nikita18
Posts: 144
Registered: ‎08-18-2012
My Device: Blackberry Curve 8520
My Carrier: Vodafone

Re: How to show a message dialog when an app is installed?

Please help me simon_hain .

Please use plain text.
Developer
simon_hain
Posts: 16,004
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: How to show a message dialog when an app is installed?

use http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/ui/UiEngine.html#pushGlobalScr...
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
nikita18
Posts: 144
Registered: ‎08-18-2012
My Device: Blackberry Curve 8520
My Carrier: Vodafone

Re: How to show a message dialog when an app is installed?

[ Edited ]

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? 

 

 

Please use plain text.
Developer
simon_hain
Posts: 16,004
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: How to show a message dialog when an app is installed?

what do you mean with "hangs/blocks my device screen" ?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
nikita18
Posts: 144
Registered: ‎08-18-2012
My Device: Blackberry Curve 8520
My Carrier: Vodafone

Re: How to show a message dialog when an app is installed?

I mean when I install my application, my device hangs. I see the cropped image of "Downloading MyBackgroundApp"..

Please use plain text.