Joel,

Set clearTaskOnLaunch for your Main activity:

http://developer.android.com/guide/topics/fundamentals.html#clearstack

Note that launching for debugging can interfere with the task stack (that's
my observation) - so to test this, make sure that the first time you launch
the app, you do this from the list of installed applications.

-- Kostya

2011/1/20 Joel <joelchen...@gmail.com>

> Hi Android Developers,
>
> I would like to have users entering my application via my Main
> Activity, from Android's menu, and from the Task Manager. Currently
> all my Activities are in single instance mode, and all my Activities
> have no history set to true except for the Main Activity.
>
> When users navigate away from my Main Activity into another activity,
> and pressing the hardware Back button from the second Activity will
> get them back to the Main Activity.
>
> However, when users navigate away from my Main Activity into another
> activity, press the hardware Home button of the Android device to get
> to Android's Home screen, access the Task Manager by holding the Home
> button, and select my application from the grid of running Activities,
> the application shows the second activity. If users press the hardware
> Back button in the second Activity, they go to Android's Home screen
> instead of Main Activity.
>
> Note that I did not call finish() on my Main Activity when launching
> the second Activity. Also, launching the application from Android's
> menu displays my desired behavior when my application is running, that
> is to show the Main Activity.
>
> How could I achieve my expected behavior of closing all Activities
> except for the Main Activity when I access my running application from
> the Task Manager?
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to