FLAG_ACTIVITY_NEW_TASK澄清需要 [英] FLAG_ACTIVITY_NEW_TASK clarification needed

查看:137
本文介绍了FLAG_ACTIVITY_NEW_TASK澄清需要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我的问题是:

  • 在我开始App1的,开放屏蔽1然后屏幕2。
  • 在我preSS家,在后台留下App1的。
  • 在我打开App2的,开始App1.Screen1与FLAG_ACTIVITY_NEW_TASK,预计将在App1.Screen2在previously留下的任务。相反,IM在App1.Screen1并呼吁onNewIntent系统()。

当我preSS回再次带来Sceen2和屏蔽1。 我不使用任何其他意图的标志或启动模式。

When I press back it brings Sceen2 and Screen1 again. I dont use any other intent flags or launch modes.

有人能解释发生了什么?

Could someone explain what's happening??

推荐答案

Android有相关的活动和任务的错误吨。

不过,谷歌改变了操作系统版本之间的任务的行为,并没有通知开发者,这是最讨厌的事情了。

Nevertheless, Google changed the behavior of tasks between OS versions and didn't notify the developers, which is the most annoying thing about it.

jakk 的 - 如果你没有在活动设置任何标志(A或B),比您所描述的行为的错误即可。

jakk - If you didn't set any flags on the activities (A or B), than the behavior you are describing is WRONG.

和所有的人这不能不说有一个与文件没有问题,试试这个:

And for all the ones which say that there is no problem with the documentation, try this:

  1. 创建与活动A(发射活动)的应用程序和放大器; B(使用默认启动模式为两个)。
  2. 启动应用程序 - 一个任务是有活性的创建仅
  3. 从活动中的一个按钮,与FLAG_ACTIVITY_NEW_TASK推出b活动。
  4. 按几次按钮,你会看到该活动B被创建多次的任务,这是不一样的文档说里面。

有更多的场景证明文档的 BAD /错的。

There are more scenarios to prove that the documentation is BAD / WRONG.

这篇关于FLAG_ACTIVITY_NEW_TASK澄清需要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆