On Mon, Mar 28, 2011 at 11:01 AM, Nathan Fig <[email protected]> wrote:
> 1) Does "clearing" the activity stack mean literally erasing it, or > having the activities cycle through onCreate() and finish()? > All activities in the stack being cleared will go through the lifecycle as if they called finish(). The root activity will generally be kept as-is. 2) How is the root activity identified? Is it simply the one with the > DEFAULT, LAUNCHER or MAIN intent filters? > This is basically the first activity in the stack. The Intent is the Intent used to start the stack. > 3) Launching from "home screen" in the documentation means the OS home > screen or applications list, correct? I.e. from not within an > application. > It doesn't really matter -- it is just whoever sets Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED. The standard launcher sets this when launching an app from an icon. You can set it yourself if you want. > 4) Does clearTaskOnLaunch clear the activity stack whenever that > activity is launched from the home screen, or just when that > activity's process is started from the home screen? Because the docs > indicate the former, but posts here indicate the latter. I guess this > depends on what the definition of "launch" is? > Whenever it is launched from the home screen. The fact that processes are killed and restarted should be invisible to the user. > I've manipulated clearTaskOnLaunch in every way imaginable with > absolutely no effect. I've placed it in my root activity in the > manifest, then placed it in EVERY activity just to be sure, restarted > my application after killing the process entirely, etc. My activity > stack is simply not being cleared. > Settings uses this as an example -- if you go in to settings, dig down a bit, press home, and then launch settings again, you will end up in the home activity instead of wherever you last went to. It just sets the flag on the main activity of its app. -- 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

