Possible Duplicate:
Quitting an application - is that frowned upon?
I am creating a button in my apps and by clicking this button, all the states will be saved and user will exit the whole application. When user re-click on the apps, he/she should be brought to the main activity. I have tried using finish() and System.exit(0) but both of these functions are just ending the current activity and bring me to the previous activity... how can i achieve this? thanks.