i did a global search for NEW_TASK, singleInstance and singleTask - couldn't find it anywhere - so I'm definitely not using any of those three.
so from what you're saying, I've got two tasks; the second time I pressed the app icon, it created a new task, leaving the old task in the background. If I always wanted to try and connect to an existing task if it existed (which I would think be the case for most applications??) then I could use singleTask, right? tia. On Sep 4, 4:55 pm, Dianne Hackborn <[email protected]> wrote: > You probably have the two activities in two different tasks, so pressing the > icon again brings the first one to the front and leave sthe second running. > You can look at "adb shell dumpsys activity" to see what the stacks look > like. Make sure you aren't using NEW_TASK, singleInstance, or singleTask. > > > > On Fri, Sep 4, 2009 at 2:56 PM, sdphil <[email protected]> wrote: > > > after reading about the android lifecycle, i put some logging in my > > current code -- > > > I get -- > > > Activity1.onCreate(null) > > Activity1.onStart() > > Activity1.onResume() > > -- initiate gui action which causes startActivity(intent) > > Activity2.onCreate(null) > > Activity2.onStart() > > Activity2.onResume() > > Activity1.onStop() > > -- press the home button > > Activity2.onPause() > > Activity2.onStop() > > -- press the icon again > > Activity1.onCreate(null) > > Activity1.onStart() > > Activity1.onResume() > > > My question is after i hit the home button, it looks like it didn't > > call Activity1.onDestroy() -- fine, no problem. But when I hit the > > application icon again, it still didn't call it, which makes me think > > there are two "tasks" running which have Activity1 as the root > > activity. Or am I missing something... > > > tia. > > -- > 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 -~----------~----~----~----~------~----~------~--~---

