Okay wait... "the activity stack doesn't have A1" on it is NOT what you have been describing. In fact this is very very different. If A1 is going away, that means it is being finished, probably by you. Given that, my first question is, when you start A2, are you doing this *after* finishing A1? If so, you have finished A1 and its task before starting A2, so A2 is now in its own new task, and when you launch A1 from home it will need to start a new instance of the activity since the task it is being launched in does not contain it and is not rooted on A1.
On Mon, May 16, 2011 at 8:42 PM, Eric <[email protected]> wrote: > I would like to simplify a question I have in a previous post. What > is supposed to happen in the following case. > > 1. Simple application with Activity A1 (MAIN/LAUNCHER) activity, and > Activity A2 (gotten to by button on Activity A1 screen). > > 2. User launches the application from icon in the LAUNCHER, navigates > into Activity A2 from button on A1. > > 3. User hits HOME button. > > 4. User re-launches application from icon in LAUNCHER. > > 5. Is the app supposed to resume the application (hence task) at > Activity A1 (root), or Activity A2 (where it left off when user hit > home)? > > - If the answer is "resume at A2", I can prove this is not happening > on API 8, 9, or 10 by submitting a very simple sample app which does > exactly as I describe above. No special manifest tags, no special > anything. The app is resuming at A1. Worse than that, the Activity > stack doesn't simply have A1 on it. It has: A1-->A2-->A1, as the > LAUNCHER seems to have put another copy of the root task on the > history. Re-entering the app, you see A1 again, thinking you're back > at root, but if you hit back-button, you go back to A2, then back > again to A1, and finally back one more time exits the app. > > - If the answer is "resume at A1", which it is currently doing in my > sample app, this is not the behavior I would expect from reading the > Task & Back Stack documentation on the developer site. The doc refer > to the case where the user "switches" back to the previous Task and > resumes what they are doing. When the documentation says "switch", > does it refer to use the Task Switcher (LONG-press on HOME)? Because > when I hit HOME, and then long-press HOME to bring up task switcher, I > do indeed return back to the application (task) where I left off. But > if I re-launch with the LAUNCHER icon, I resume at the root A1. > > -- > 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 > -- 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

