android flag_activity_new_task结束,android - FLAG_ACTIVITY_NEW_TASK clarification needed - Stack Overf...

The FLAG_ACTIVITY_NEW_TASK places your new activity on a new task stack. I'm going to refer to the activities as A and B.

When you launch the first app, you have a single task with A in it. Task 1 = A

Clicking on the second activity puts B in the task. Task 1 = AB

When you click home you preserve the task. Task 1 = AB (still)

Opening the second app and send the A intent with the new task flag a NEW task will be created with only A on it. Now you have two tasks. Task 1 = AB, Task 2 = A

Unwrapping this arrangement with the back key will result in 2A, 1B, 1A which is what you are seeing. This is the expected result.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值