07-26-2012 02:48 AM
How to stop the application running in the background in blackberry curve 9320?
i used the following code to move the application to background
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...
07-26-2012 03:05 AM
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 .
07-26-2012 04:34 AM
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?