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
New Contributor
Posts: 3
Registered: ‎12-01-2010
My Device: BlackBerry 8900
My Carrier: Vodafone
Accepted Solution

How to stop a background process/thread?

Hi,

 

Our previous BlackBerry application has been made by someone else and now we want to make some changes to it.

 

The problem I'm working on now is that there was no way you could close the application, because the menu key was disabled (it always kept on running in the background). This combined with the fact that the application is creating a new thread, meant that when you looked over all the currently running programs, you had 2 processes that you could not stop.

 

Since then I have fixed the problem with the menu key and now I can stop the main application, but the background thread keeps on appearing as a currently running process (when I choose to switch applications).

 

So after this story, my question is:

 

How can you stop a background process?

 

In my case I want to stop the background process that the application started at some point and now won't close...

 

Thanks!

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to stop a background process/thread?

welcome to the support forums.

 

you can stop the background process using global events.

implement a globaleventlistener in the background process and define a terminate event.

 

or you could mark it as a system module, it would not show up in the task manager, then.

----------------------------------------------------------
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
Highlighted
New Contributor
Posts: 7
Registered: ‎01-03-2012
My Device: 8900
My Carrier: Airtel

Re: How to stop a background process/thread?

kindly send the sample code ?..............

 

 

 

 

 

Regards,

saiswaroop