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
Posts: 242
Registered: ‎02-19-2013
My Device: 9500
Accepted Solution

Alert message in thread.

Application.getApplication().invokeLater(new Runnable() {
                        public void run() {
                            Dialog.alert("Your Mobile Detective trail has expired. Please contact us on 0861555554 to arrange payment and activation.");
                            int count1 = Integer.parseInt(count) + 1;
                            try {
                                LocalStorage.storePopUpCount(String.valueOf(count1));
                            } catch (MySystemException e) {
                                System.out.println("Exception occur" + e.toString());
                            }
                        }
                    });

 

This is not displaying the alert. can anone one suggest me why its so?

Developer
Posts: 16,575
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Alert message in thread.

not without the context. why Application? Is there no UiApplication?
----------------------------------------------------------
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
Developer
Posts: 242
Registered: ‎02-19-2013
My Device: 9500

Re: Alert message in thread.

application is running in background. I want to give the alert in my one thread.

Developer
Posts: 16,575
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Alert message in thread.

if the application has no UI you have to use a different method to show stuff. http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/ui/Ui.html#getUiEngine() together with 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