When running an application, when the home key is pressed the mobile home page comes to the front. How can i do the same on click of a button named exit ?
+1
A:
Short answer.. you can call finish()
to end the current activity (this will not kill your application). However I think you should really consider your decision to include a type of "Exit" button in your application. Please review the mechanics of android and some of the information regarding this behavior.
There is a very nice answer here.
Quintin Robinson
2010-06-23 07:00:55
A:
The Android home screen is an activity and you can launch it like other activities, by using Intent with the android.intent.action.MAIN action and the android.intent.category.HOME category.
kankan
2010-06-23 09:59:51
Hey thanks, that is what i wanted exactly.
AceAbhi
2010-06-24 06:19:42