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: 296
Registered: ‎12-07-2008
My Device: Not Specified

Best way of doing this?

Okay I have a background thread that runs on start up and it impliments a phone listner. I also have a gui that is launched by the background app. The gui also needs a phone listener.


I was just wondering what would be the best way to impliment the phone listener on both the gui and background. It seems redundant to start up two listeners in the same app, but I'm not too sure on how to do it a diffrent way.



BlackBerry Development Advisor
Posts: 15,874
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Best way of doing this?

You can find an example for this at the link below.  The sample uses a FolderListener instead of a PhoneListener, but the concept is the same.


How To - Allow a background listener to detect and update a GUI application
Article Number: DB-00406


Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: Best way of doing this?

try implementing an alternate entry point. so you only have one application which automatically runs on startup. so in your case, your listener will run on the background during device startup. then on your home screen you have an icon where it serves as your GUI entry point of your background application. so basically you only have one listener running.