On Wed, Apr 27, 2011 at 9:55 PM, Eric <[email protected]> wrote:

> This seems to work empirically, HOWEVER, I don't understand "why"
> this works, after I have already navigated around in Task B?  I
> understand why it would work the first time, to start Task B, but I
> don't understand why on subsequent calls, when I perform startActivity,
> Task B is resume dat the last Activity (B3) it left off from, rather
> than add a new Activity (B1) to Task B's stack, such that the stack is
> B1, B2, B3, B1.  While I WANT it to resume Task B where it left off, I don't
> understand why Task B doesn't have an extra Activity B1 added to the end
> after I startActivity on subsequent starts?  None of the Activities are
> defined as 'singleTop', or 'clearTop', or whatever. They are standard
> Activities in the manifest.
>

As described:

http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_NEW_TASK
<http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_NEW_TASK>

"When using this flag, if a task is already running for the activity you are
now starting, then a new activity will not be started; instead, the current
task will simply be brought to the front of the screen with the state it was
last in."

4. Following up on point 3, what if I DO want to switch to Task B, and add a
> new Activity B1 to the end of the stack?  What call would I make (from the
> menu action code) to do this?
>

The rest of that documentation:
"See 
FLAG_ACTIVITY_MULTIPLE_TASK<http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_MULTIPLE_TASK>
for
a flag to disable this behavior."

5. I don't understand how the LAUNCHER does this either, that is, resume a
> Task at the last place it left off, rather than add a new Activity (root
> Activity) to the end of the Task's back stack?  I assume the LAUNCHER is
> doing the same thing I'm doing in the menu action call?
>

See above.


I don't know about the rest.

I hope my questions makes sense, and I'm not thinking about this wrong.  If
> I am, I would appreciate it if someone would describe the proper way to have
> multiple Tasks within an Application, and the proper way to jump around to
> each Task.  Or, possibly suggest another Paradigm that will achieve the same
> goal without the use of multiple Tasks?
>

What goal? What are you actually trying to achieve with all this?

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 
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