活动标记为QUOT; SingleTask"带过来 [英] Activity marked as "SingleTask" brought forward

查看:127
本文介绍了活动标记为QUOT; SingleTask"带过来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想环绕Android的活动发射模式下,所有的不同的选择我的头(见文档:的任务和返回堆栈

根据该文件,启动标记为singleTask活动时:

  

...而是,无论是新任务开始的浏览器,或者,如果   浏览器已经在后台运行的任务,该任务是   提出来处理新的意图。

<据singleTask描述的方式,无论是新的任务创建,或者,如果该活动中已存在一些其它的任务,该任务是提出

在的情况下,会发生什么的浏览器的活动的一个实​​例(例如)已经在我的应用程序的活动相同的任务(堆栈)存在(但不是在前台)?它是如何提出?这不是在doc描述

解决方案

SingleTask - 系统在新任务和路线的根目录下创建活动意图吧。然而,如果已经存在该活动的一个实​​例,系统路线的意图,通过调用其onNewIntent()方法存在的实例,而不是创建一个新的。

注:SingleTask和SingleInstance用于专门的发布会。不建议普遍使用

从这个链接的http:// developer.android.com/guide/topics/manifest/activity-element.html

I am trying to wrap my head around all the different options of Android's Activity launch mode (See documentation:Tasks and Back Stack

According to the documentation, when launching an activity that is marked as "singleTask":

"... Instead, either a new task starts for the Browser or, if the Browser already has a task running in the background, that task is brought forward to handle the new intent."

According to the way singleTask is described, either a new task is created, or, if the activity already exists in some other task, that task is brought forward.

What happens in case an instance of the Browser activity (for example) already exists in the same task (stack) of my app's activity (but not in the foreground) ? How is it brought forward? This is not described in the doc.

解决方案

"SingleTask" - The system creates the activity at the root of a new task and routes the intent to it. However, if an instance of the activity already exists, the system routes the intent to existing instance through a call to its onNewIntent() method, rather than creating a new one.

Note: SingleTask and SingleInstance are used for specialized launches . It is not recommended for general use

From this link http://developer.android.com/guide/topics/manifest/activity-element.html

这篇关于活动标记为QUOT; SingleTask&QUOT;带过来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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