FLAG_ACTIVITY_NEW_TASK澄清需要FLAG_ACTIVITY_NEW_TASK

由网友(年少轻狂最情深)分享简介:所以,我的问题是:在我开始App1的,开放屏蔽1然后屏幕2。在我preSS家,在后台留下App1的。在我打开App2的,开始App1.Screen1与FLAG_ACTIVITY_NEW_TASK,预计将在App1.Screen2在previously留下的任务。相反,IM在App1.Screen1并呼吁onNewI...

所以,我的问题是:

在我开始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:

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

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

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

阅读全文

相关推荐

最新文章