Thanks Mark,
Regards, Vaibhav On Tue, Sep 30, 2008 at 5:14 AM, Mark Murphy <[EMAIL PROTECTED]>wrote: > > [EMAIL PROTECTED] wrote: > > But what if I currently have 3 activities in the stack and on the 3rd > > activity I have a menu item saying "Exit application" and with that I > > want to return to home screen. > > Three options off the top of my head are: > > 1. Don't have three activities on the stack. Use tabs, dialogs, > ViewFlipper, or some other means to consolidate all that into a single > activity. Then, call finish() on that activity from your menu item. > > 2. Have activity #3 broadcast an intent to the other two, to tell them > to close up, then call finish() on the third activity. I'm not sure what > this will look like to the user, though -- might be a lot of flicker. > > 3. Just don't do it. Work within the Android model rather than attempt > to impose your own model on top of it. Redesign your flow such that the > activity (or activities) appear to live forever. > > Also, bear in mind that finish() does not return you to the home screen, > but merely to whatever was next on the stack of activities. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com > > Android Training on the Ranch! -- Mar 16-20, 2009 > http://www.bignerdranch.com/schedule.shtml > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" 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-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

