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

New Contributor
Posts: 4
Registered: ‎01-23-2013
My Device: Blackberry 9900
My Carrier: Vodafone

How to show dialog on application start-up



I have a scenario in my application, where on app start I have to check whether the local database data is up-to-date or not. In case the data is not up-to-date, I have to show a dialog asking the user to update the database. The user has the option to select "update now" or "update later".


This dialog has to pop up after a fixed interval(suppose after every 2 hours) automatically if the user doesn't update his database.


I am getting runtime exception when I try to show the dialog in the same thread. By reading various forum, I found out that this can be achieved by opening the dialog in a separate thread. In that case I won't be able to communicate between user input value and application(as they are two separate thread).


Can anyone help me out here? Is this functionality achievable ? If yes, the how? If no, what can be the alternate option?


I am targeting Blackberry OS 5.0 and above.



Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to show dialog on application start-up

you can communicate between threads.
if all else fails you can use global events etc.
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
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to show dialog on application start-up

Just to expand a little on what Simon has said. 


The whole BlackBerry system is just a series of Threads all doing different things and they all communicate.  The important thing is that the Threads share Objects. And if you need to co-orindate activity, then look at wait/notify. 


Please avoid Global Events, I have worked on a system that used Global Events to communicate between various parts of the application and that was a singificant overhead just to provide intra application message switching.