asfman
android developer
posts - 90,  comments - 213,  trackbacks - 0

1. "singleTask"
The system creates a new task and instantiates the activity at the root of the new task. However, if an instance of the activity already exists in a separate task, the system routes the intent to the existing instance through a call to its onNewIntent() method, rather than creating a new instance. Only one instance of the activity can exist at a time.
Note: Although the activity starts in a new task, the BACK key still returns the user to the previous activity. 


官方说activity还不存在的时候会以activity为根新建一个task.但实际测试情况是这样的:

    假如activity:activity_Caller 调用设置了android:lauchMode="singleTask"的activity:activity_singleTask 。
    1. 如果activity_Caller  和 activity_singleTask 在同一个application,那么不会新创建一个task.
 
    2.如果不在同一个application,但是activity_singleTask已经在task中,那么就不会创建新的task。
总结:
      只有在activity_singleTask不存在任何task中,并且activity_single所在的application中的任何activity不存在在task中,并且跟调用者acitivity_caller不再同一application的时候,才会创建一个新的以它为根的task.

posted on 2011-06-17 11:13 汪杰 阅读(213) 评论(0)  编辑 收藏 引用 所属分类: Java
只有注册用户登录后才能发表评论。

<2009年3月>
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

常用链接

留言簿(15)

随笔分类(1)

随笔档案(90)

文章分类(727)

文章档案(712)

相册

收藏夹

http://blog.csdn.net/prodigynonsense

友情链接

最新随笔

搜索

  •  

积分与排名

  • 积分 - 457547
  • 排名 - 6

最新随笔

最新评论

阅读排行榜

评论排行榜