Hi Dianne,

I guess I'm not understanding the default process creation method.
Using a new project, with two activities, A and B (both have no custom
flags set in the manifest, and Activity A is set as MAIN and
LAUNCHER):

1) Launch the app from the app drawer
2) Have activity A start activity B.
3) Hit the home button.
4) Go to the app drawer again, try launching the app again.
5) Looks like a brand new process instance of the app is created,
instead of returning to the original process instance that's already
in the background. As a user, I'd (personally) rather just return to
the instance already running in the background, rather than create a
new instance.

For my application, it doesn't make sense to open multiple instances
of the application. Like the Browser application, there should really
only be one instance, and anytime the user hits the Browser app icon,
they should just return to any running instance they have on the
system, rather than create a new one.

So I'm trying to figure out which flags will let me do that - and
that's how I got to using "singleTask" for my entry-point activity,
hoping that would tell the system to not create multiple instances of
my app.

Thanks



On Dec 1, 12:59 pm, Dianne Hackborn <[email protected]> wrote:
> Try looking at the event log to see if/why activities are being finished --
> "adb logcat -b events"
>
> Try looking at the activity manager state to see what is going on with your
> activities -- "adb shell dumpsys activity"
>
> Oh and also -- first off don't use singleTask.  Do you really know what it
> is doing?  There are very very few things that actually should use it, and
> that pretty universally is because they get launched by other applications.
>  If your app isn't launched from other applications (besides home and such),
> then singleTask does you know good and can result in behavior you do not
> want.
>
> Other than that, neither of you have supplied nearly enough information to
> provide help.  All I can say is -- just making the first activity singleTask
> is not going to cause this, so there must be something else going on.  For
> example, making other activities besides the root singleTask, or setting
> various flags that cause activities to clear, or setting various manifest
> attributes that do the same thing.
>
>
>
> On Tue, Dec 1, 2009 at 4:59 AM, Mark Wyszomierski <[email protected]> wrote:
> > I'm seeing the same behavior. Going back to the home screen, then
> > returning to the process clears everything back to the root.
>
> > On Nov 16, 12:42 am, pink 444 <[email protected]> wrote:
> > > Hi all,
>
> > >         I have a task,which is created when an activity with
> > > "singleTask" launch mode is activated.
>
> > >        I added some more activities to the task.But whenever i move
> > > out of the task and come back to the task, activity stack is being
> > > cleared up to  root of the stack.
>
> > >       Why is this happening?
>
> > >       If activity launch mode is "singleTask" ,Is activity stack
> > > cleared automatically up to root of the stack.If that is the default
> > > behavior how can we change the behavior.
>
> > >      Any help would be appreciated highly.
>
> > > Regards,
> > > -Siva.
>
> > --
> > 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]<android-developers%[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

Reply via email to