On Sun, Jun 26, 2011 at 6:24 AM, Hitendrasinh Gohil <[email protected]> wrote: > I need to do something like i.e when user clicks on quit button all > activities should be finish and homescreen should come.
The user can press the HOME button for that. Android applications do not need a "quit" button. http://blog.radioactiveyak.com/2010/05/when-to-include-exit-button-in-android.html http://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon/2034238#2034238 Now, if by "homescreen" you mean the main activity of your application, simply add FLAG_ACTIVITY_CLEAR_TOP|FLAG_ACTIVITY_SINGLE_TOP to the Intent you would use to ordinarily start that activity. The resulting startActivity() call will bring your main activity to the foreground and remove other activities in your back stack. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android 3.1 Programming Books: http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

