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
Contributor
senthil_25
Posts: 45
Registered: ‎11-10-2010
My Device: Not Specified

stop the application which run on background in blackberry curve 9320

How to stop the application running in the background in blackberry curve 9320?

 

i used the following code to move the application to background 

 

UiApplication.getUiApplication().requestBackground();

 

now i want to stop the application for that i am now delete the application each time so that the

mobile restart everytime when i delete the application so i want to stop the application which is running

background without delete the application...

Developer
kamal_nigam
Posts: 434
Registered: ‎07-23-2012
My Device: Blackberry 10

Re: stop the application which run on background in blackberry curve 9320

What do you mean by stop the application? (network connection or Thread ?? )It’s up to your logic. 
You can use [public final boolean isForeground()] to check the application in forground  or not and take your decision . 
Thanks
-------------------------------------------------------------------------------------
Press the Accept as solution Button when u got the Solution
Press Kudo to say thank to developer.
-------------------------------------------------------------------------------------.
Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: stop the application which run on background in blackberry curve 9320

There is no way in the Operating System for a user to be able to stop an application, foreground or background, so this is something you are going to have to do yourself.

 

I presume that because you have taken it to the background, you can also bring it to the foreground.  My guess is that instead of stopping the application, your code takes it to the background.  Yet there are some circumstances in which you wish to stop the application.  Typically in this sort of situation, I would suggest that you have, hidden in a difficult to find place (perhaps the Setup screen), an 'Exit' menu item.  You could make sure this asks for confirmation but if the user persists, then Use the normal System.exit(0) to stop your application.

 

Does this answer the question?