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
Posts: 28
Registered: ‎06-25-2009
My Device: 9930
My Carrier: China Telecom
Accepted Solution

How can i kill a running application in my code? is that possible?

i can get app list running in memory through follow code:

 

_appDes     = _appManager.getVisibleApplications();

 

including the pid, icon, modulehandle, modulename, and etc.    

 

how can i kill the application?  is there such blackberry api? 

Developer
Posts: 432
Registered: ‎02-23-2009
My Device: Not Specified

Re: How can i kill a running application in my code? is that possible?

You can post a GlobalEvent to that application and kill that application in eventOccured function of GlobalListener. Implement GlobalLIstener in your app.

 

 


Press the kudos button to thank the user who helped you.

If your problem was get solved then please mark the thread as "Accepted solution".

 

Deepesh Gupta
Highlighted
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: How can i kill a running application in my code? is that possible?

If "victim" application somehow (for example via global event listener) expects a signal then you can kill it via posting a relevant global event.

 

But if it does not know neither expect that you are going to kill it - you cannot do that.

Developer
Posts: 432
Registered: ‎02-23-2009
My Device: Not Specified

Re: How can i kill a running application in my code? is that possible?

 


If your problem was get solved then please mark the thread as "Accepted solution".

 

Deepesh Gupta
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: How can i kill a running application in my code? is that possible?

Check this KB aricle for GlobalEventListener implementation.

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800620/What_Is...


Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 28
Registered: ‎06-25-2009
My Device: 9930
My Carrier: China Telecom

Re: How can i kill a running application in my code? is that possible?

thanks all !  

 

that means , if the victim application does not support the message or not coorprates, i can not do that ?

 

more question :

 

when the blackberry powering off, it must close all applications,  how does it do?

 

 

it seems that i can't implement a task manager like  in windows mobile system.

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: How can i kill a running application in my code? is that possible?

if the victim application does not support the message or not coorprates, i can not do that ?

 

Yes, you're right.

 

when the blackberry powering off, it must close all applications,  how does it do?

 

When the device is completely shutting off it shuts off the Java Virtual Machine, than does low-level stop for all running processes.