My application works fine . But i want the process to run forever .
So when the user presses exit i put the application to background by the following code .
But my problem is when next time user opens the application , it opens well but does not close.
What can be the solution ? I want the application to move frequently on foreground and background .