Android:Allow Task Reparenting:[boolean]
2015-09-28 14:03
411 查看
是否允许这个Activity从启动它的这个Activity所在的Task转移到和它有相同亲和力的Task。默认值为false。
例如,在一个e-mail里,包含一个超链接。而用来显示超链接页面的Activity是在浏览器这个应用中定义的。如果用来显示超链接页面的Activity允许reparent到浏览器这个应用的话,当下次浏览器这个应用运行到前台的时候,这次打开的超链接的这个页面会再次显示,而当e-mail这个应用再次运行到前台的时候,打开超链接的这个Activity不会再次显示。因为在第一次打开这个超链接页面之后,e-mail应用运行在后台时,这个打开超链接的Activity已经reparent到了浏览器的task。
英文说明:
Whether or not the activity can move from the task that started it to the task it has an affinity for when that task is next brought to the front
— "true" if it can move, and "false" if it must remain with the task where it started.
If this attribute is not set, the value set by the corresponding allowTaskReparenting attribute of the <application> element applies to the activity.
The default value is "false".
Normally when an activity is started, it's associated with the task of the activity that started it and it stays there for its entire lifetime.
You can use this attribute to force it to be re-parented to the task it has an affinity for when its current task is no longer displayed. Typically, it's used to cause the activities of an application to move to the main task associated with that application.
For example, if an e-mail message contains a link to a web page, clicking the link brings up an activity that can display the page. That activity
is defined by the browser application, but is launched as part of the e-mail task. If it's reparented to the browser task, it will be shown when the browser next comes to the front, and will be absent when the e-mail task again comes forward.
The affinity of an activity is defined by the taskAffinity attribute. The affinity of a task is determined by reading the affinity of its root activity.
Therefore, by definition, a root activity is always in a task with the same affinity. Since activities with "singleTask" or "singleInstance" launch modes can only be at the root of a task, re-parenting is limited to the "standard" and "singleTop" modes. (See
also the launchMode attribute.)
例如,在一个e-mail里,包含一个超链接。而用来显示超链接页面的Activity是在浏览器这个应用中定义的。如果用来显示超链接页面的Activity允许reparent到浏览器这个应用的话,当下次浏览器这个应用运行到前台的时候,这次打开的超链接的这个页面会再次显示,而当e-mail这个应用再次运行到前台的时候,打开超链接的这个Activity不会再次显示。因为在第一次打开这个超链接页面之后,e-mail应用运行在后台时,这个打开超链接的Activity已经reparent到了浏览器的task。
英文说明:
Whether or not the activity can move from the task that started it to the task it has an affinity for when that task is next brought to the front
— "true" if it can move, and "false" if it must remain with the task where it started.
If this attribute is not set, the value set by the corresponding allowTaskReparenting attribute of the <application> element applies to the activity.
The default value is "false".
Normally when an activity is started, it's associated with the task of the activity that started it and it stays there for its entire lifetime.
You can use this attribute to force it to be re-parented to the task it has an affinity for when its current task is no longer displayed. Typically, it's used to cause the activities of an application to move to the main task associated with that application.
For example, if an e-mail message contains a link to a web page, clicking the link brings up an activity that can display the page. That activity
is defined by the browser application, but is launched as part of the e-mail task. If it's reparented to the browser task, it will be shown when the browser next comes to the front, and will be absent when the e-mail task again comes forward.
The affinity of an activity is defined by the taskAffinity attribute. The affinity of a task is determined by reading the affinity of its root activity.
Therefore, by definition, a root activity is always in a task with the same affinity. Since activities with "singleTask" or "singleInstance" launch modes can only be at the root of a task, re-parenting is limited to the "standard" and "singleTop" modes. (See
also the launchMode attribute.)
相关文章推荐
- Android:Task Affinity:[string]
- Android:Launch Mode:[enum]
- Android中xml实现效果三:圆角按钮
- Android中xml实现效果二:边框效果
- Activity,Window和View之间的区别
- Android 永久化保持客户端和服务器连接cookieStore
- Android计算TextView的宽度
- Android TextureView简易教程
- android string.xml 格式(空格 回车等)
- 【小知识点总结】保存android日志logcat到文件中
- Android中xml实现效果一:xml画圆形
- Android获取系统时间
- Android实现复制粘贴
- 如何使Android应用程序获取系统权限
- Android隐藏虚拟按键(底部导航栏)
- canvas的save()和restore()运用
- Error : Android Studio 找不到模拟器
- Android 建立View 圆角
- 控件点击变样,离开后控件还原
- Android NotificationManager 和Notification的使用总结 转