singleTask和singleInstance之间的区别 [英] Difference between singleTask and singleInstance

查看:117
本文介绍了singleTask和singleInstance之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在StackOverflow上找不到任何可以回答我问题的线程.我已经看过 Android singletop singleinstance和singletask ,但是这个问题与他的项目有关场景.

I did not find any thread on StackOverflow that answer my question. I have already seen this Android singletop singleinstance and singletask but that question is related to his project scenario.

singleTask和singleInstance有什么区别?我已经阅读了文档,但听不懂.

What are the differences between singleTask and singleInstance?? I have read the docs but could not understand..

我也已阅读此线程 Android singleTask或singleInstance启动模式?但我听不懂.抱歉

I have read this thread also Android singleTask or singleInstance launch mode? but I could not understand. Sorry

推荐答案

"singleTask"和"singleInstance"模式也各不相同 其他仅在一个方面:"singleTask"活动允许其他 活动是其任务的一部分.它始终是其根源 任务,但其他活动(必要时是标准"和单顶" 活动)可以启动到该任务中.一个"singleInstance" 另一方面,活动不允许其他活动成为其中的一部分 它的任务.这是任务中唯一的活动.如果它开始另一个 活动,则该活动被分配给其他任务-好像 有意参加FLAG_ACTIVITY_NEW_TASK.

The "singleTask" and "singleInstance" modes also differ from each other in only one respect: A "singleTask" activity allows other activities to be part of its task. It's always at the root of its task, but other activities (necessarily "standard" and "singleTop" activities) can be launched into that task. A "singleInstance" activity, on the other hand, permits no other activities to be part of its task. It's the only activity in the task. If it starts another activity, that activity is assigned to a different task — as if FLAG_ACTIVITY_NEW_TASK was in the intent.

这篇关于singleTask和singleInstance之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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