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

Posts: 13
Registered: ‎08-17-2012
My Device: BlackBerry Bold 9790
My Carrier: Comcel

How to wait for global events

[ Edited ]

I have an application that runs another instance of itself. The second instance is a background app that does some work for the first app on demand by responding to global events, therefore the second app doesn't display a UI and doesn't call Application.enterEventDispatcher. By implementing GlobalEventListener, I can register to receive global events. The problem is, the second app does this and then immediately exits, because there's nothing keeping it from returning from the "main" method, like an Application.enterEventDispatcher call or anything else that blocks until exiting is desired. So I'd like to know if there's a way to not just receive global events, but actually wait for them (block). That way the first app could post an "exit" event when exiting is desired. Or if anybody has other suggestions as to how to block until the first app wants the second app to exit.

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

Re: How to wait for global events

you can use enterEventDispatcher without having a UI by using Application instead of 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