This does NOT exit the application, it just kills its current process, and
if the user is down in a couple activities, all this ends up doing is
removing the top activity (because it went away without saving its state)
and goes to the previous one.  And if there are other things running in the
process such as services, they will be started right back up.

Also, notice how NO standard applications in android have a quit command?
This is not a standard part of the android UI model, and there is no need
for it.

On Thu, Aug 20, 2009 at 5:27 AM, brian.schimmel <
[email protected]> wrote:

>
> I think this will just work fine:
>
> android.os.Process.killProcess(android.os.Process.myPid());
>
> As far as I know, it kills the current DalvikVM right on the spot, so
> be careful.
>
> On 10 Aug., 20:49, jhoffman <[email protected]> wrote:
> > It really depends on the structure of your app, but one trick you
> > might employ is to launch your various activities with
> > startActivityForResult(intent, ID);
> > and then override onActivityResult to watch for a return value from
> > the activity you launched. You can then make decisions about whether
> > you should call finish() in the original activity, or whether the user
> > just wanted to go back to that original activity without closing the
> > entire app.
> >
> > Again, without knowing the structure of your app or more details, I
> > can't be sure that this is actually going to be helpful to you. If it
> > isn't though, feel free to post some specifics! :)
> >
> > On Aug 10, 2:36 am, Blackmarket <[email protected]> wrote:
> >
> > > Hi,
> >
> > > i want to add anexitbutton to the menu, but didn't see an easy way
> > > to close anapplicationor acces all activities of anapplicationand
> > > finish them. Is there an easy approach avaible?
> >
> > > Regards, Pascal
> >
> >
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to