When L starts A at the step 3 ,you want only one A  or two instances of A?
If only one , use the flag " singleTask ",if two, do nothing .

Can you describe you problem more exactly?
I do not understand you want the L A B in the same task or not.
-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of James Wang
Sent: Friday, June 11, 2010 12:09 AM
To: Android Developers
Subject: [android-developers] Re: TaskAffinity causes new instance being 
created when startActivity

Dianne, You are right.
We did want to make an activity like launcher.

In fact, our product is more complicated than what I said above.

Below is the real plan:
1)We made an activity as the launcher L;
2)A tells L to start B;
3)B does something and tells L starts A again.

L,A,B have the same taskAffinity. And L starts B and A with NEW_TASK.

BTW, I noticed such words in SDK reference:
"Similarly, a new instance of a "singleTop" activity may also be
created to handle a new intent. However, if the target task already
has an existing instance of the activity at the top of its stack, that
instance will receive the new intent (in an onNewIntent() call); a new
instance is not created. In other circumstances — for example, if an
existing instance of the "singleTop" activity is in the target task,
but not at the top of the stack, or if it's at the top of a stack, but
not in the target task — a new instance would be created and pushed on
the stack."

It says if A is singleTop, A gets created twice is supposed to be true
because A is not on the top of task.
But we did not set A as singleTop.

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

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