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
Iyenemi_Tyger
Posts: 132
Registered: ‎10-25-2011
My Device: Tour 9630
Accepted Solution

background process issue

Hello and good day ,
I have a bb app that uses alternate entry points now I am running 2 apps one is an application (where my background thread is that fetches messages from server ) and the other is a uiapplication , I observed that when I close my ui app with activescreen.close my background app also terminates which is not supposed to be the case , please any thoughts will be accepted thank you .
Please use plain text.
Trusted Contributor
gopi
Posts: 126
Registered: ‎10-15-2010
My Device: Torch 9850

Re: background process issue

Hi, did you ever tired to make to ui to request background on closing app and check whether the background is active.

Please use plain text.
Developer
peter_strange
Posts: 19,608
Registered: ‎07-14-2008
My Device: Not Specified

Re: background process issue

"I observed that when I close my ui app with activescreen.close my background app also terminates"

 

This should not happen and I can confirm does not happen in general.  So I suspect the fact that your background Application closes is something in your code. 

 

A few comments:

 

Are you sure your Background Application is closed?  Have you debugged the code and seen it go through System.exit(..)?

 

You must also be very carefully when you have two applications that you know what data they are actually sharing and how they are communicating.  Specifically any static variables that you think are shared are NOT. 

 

And a lot of people think they have a Background application because they have started Threads in the main using a different alternate entry to their UI, but these Threads are not an Application.  To start an Application you have to have used enterEventDispatcher on an Application object.  If you haven't done that you don't have a Background Application.

 

So revisit your code and make sure you are doing what you think you are. 

Please use plain text.
Developer
Iyenemi_Tyger
Posts: 132
Registered: ‎10-25-2011
My Device: Tour 9630

Re: background process issue

Thanks peter I missed to attach enterEventDispatcher on the background application , I guess that is why , I just read your post and it got to me , thanks peter .
Please use plain text.