[android-developers] Re: TaskAffinity causes new instance being created when startActivity

2010-06-13 Thread James Wang
Thanks, YangJian.

What we want is to put all activities started by L stay in the same
task as L. So we have to set all activities`s taskAffinity the same
one.
For that reason, Single Task is not for what we want, because it is
goint to make A as root of that task which is L in fact.

Thanks, Dianne.
We just want all activities developed by as in the same task.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: TaskAffinity causes new instance being created when startActivity

2010-06-13 Thread Dianne Hackborn
If you want everything running in the same task, then don't use
FLAG_ACTIVITY_NEW_TASK.

On Sun, Jun 13, 2010 at 5:59 AM, James Wang jameswangc...@gmail.com wrote:

 Thanks, YangJian.

 What we want is to put all activities started by L stay in the same
 task as L. So we have to set all activities`s taskAffinity the same
 one.
 For that reason, Single Task is not for what we want, because it is
 goint to make A as root of that task which is L in fact.

 Thanks, Dianne.
 We just want all activities developed by as in the same task.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: TaskAffinity causes new instance being created when startActivity

2010-06-10 Thread James Wang
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


RE: [android-developers] Re: TaskAffinity causes new instance being created when startActivity

2010-06-10 Thread 楊健
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: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: TaskAffinity causes new instance being created when startActivity

2010-06-10 Thread Dianne Hackborn
If they are modelling separate applications, then they each need to have a
different task affinity.  Having the same affinity means that when you start
the activity, it will have an affinity for an existing task with the same
name.

On Thu, Jun 10, 2010 at 8:09 AM, James Wang jameswangc...@gmail.com wrote:

 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 android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: TaskAffinity causes new instance being created when startActivity

2010-06-09 Thread James Wang
Can anybody help me?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en