Hi Dianne,
Thank you for this. It's working well with one half of the application, but I'm
having trouble with going back to the other half.
For example:
Area A
Activities 1 2 3 4 5
Area B
Activities 6 7 8 9
The application starts in Area A Activity 1. If I navigate to 6 => 7 => 8 => 1
=> 2 then navigate to Area B I am at 8 which is perfect.
However, when I try to go back to Area B, I end putting Activity 1 on the stack
(so if I hit the back button I go back to 2).
I was hoping I could simply group the Activities by using
android:taskAffinity=".otherstuff" alone but I'm probably misunderstanding the
flag or setting up the Intent incorrectly.
The intents I'm using (to move between Areas) are:
(to go to Area B)
i = new Intent(this, B.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
(to go to Area A)
i = new Intent(this,A.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
I feel like it's really close and was wondering if you (or someone) can see
where I might be going wrong.
Regards,
Julius.
On 8/03/2011, at 11:40 AM, Dianne Hackborn wrote:
> Use android:taskAffinity to specify the affinity of activities in your second
> task. (For example android:taskAffinity=":otherstuff"). When you want to
> switch between these tasks in your UI flow, use Intent.FLAG_ACTIVITY_NEW_TASK
> to switch to the other task. There are lots of subtleties you will get in to
> about what happens to the state of the task when you switch to it, since you
> are essentially becoming an app switcher at that point.
>
> On Mon, Mar 7, 2011 at 2:29 PM, Julius Spencer <[email protected]> wrote:
> Hi,
>
> I was wondering whether it's possible to have two Activity stacks in an
> application so if a user is using one part of an application and navigates to
> another area and then navigates back (without using the back button) to the
> original area he has the same "history" of Activities.
>
> Regards,
> Julius.
>
> --
> 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