Chinaunix首页 | 论坛 | 博客
  • 博客访问: 307888
  • 博文数量: 46
  • 博客积分: 1517
  • 博客等级: 上尉
  • 技术积分: 530
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-31 18:21
文章分类

全部博文(46)

文章存档

2012年(1)

2011年(1)

2010年(3)

2009年(2)

2008年(25)

2007年(13)

2006年(1)

我的朋友

分类: LINUX

2010-06-17 11:03:34

调试程序时,遇到一个问题:先启动程序A,然后Home挂起到后台,然后启动程序B,在B中通过sendBroadcast启动程序A的一个Activity(A中有个receiver,来接收广播,然后启动activity/使用了New_TASK flag),问题出现了,这个Acitivty结束时,不是返回B,而是返回先前挂起的A。
解决方法:setActivity时设置flag:NEW_TASK|MULTIPLE_TASK
MULTIPLE_TASK: used in conjunction with FLAG_ACTIVITY_NEW_TASK to disable the behaviror of bringing an existing task to thre forgefround. When set, a new task is always started to host the Activity for the Intent, regardless of whether there is already an existing  task running the same thing.
阅读(2732) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~