关于FLAG_ACTIVITY_MULTIPLE_TASK

FLAG_ACTIVITY_MULTIPLE_TASK 

总结:
1、使用改标记,需要自行管理Activity
2、需要与FLAG_ACTIVITY_NEW_DOCUMENT或者FLAG_ACTIVITY_NEW_TASK共同使用

    /**
     * This flag is used to create a new task and launch an activity into it.
     新建任务,并在其中启动activity
     
     * This flag is always paired with either {@link #FLAG_ACTIVITY_NEW_DOCUMENT}
     * or {@link #FLAG_ACTIVITY_NEW_TASK}. 
     这个标记通常与FLAG_ACTIVITY_NEW_DOCUMENT或者FLAG_ACTIVITY_NEW_TASK共同使用
     
     In both cases these flags alone would
     * search through existing tasks for ones matching this Intent.
     FLAG_ACTIVITY_NEW_TASK和FLAG_ACTIVITY_NEW_DOCUMENT,单独使用将会搜索已存在的任务链,来获取匹配当前Intent的任务
     
      Only if no such
     * task is found would a new task be created. 
     只有找不到符合要求的任务,才会创建新的任务
     
     When paired with
     * FLAG_ACTIVITY_MULTIPLE_TASK both of these behaviors are modified to skip
     * the search for a matching task and unconditionally start a new task.
     当结合FLAG_ACTIVITY_MULTIPLE_TASK使用,就会跳过搜索符合要求的任务,无条件的启动一个新任务
     
     *
     * <strong>When used with {@link #FLAG_ACTIVITY_NEW_TASK} do not use this
     * flag unless you are implementing your own
     * top-level application launcher.
     当使用了FLAG_ACTIVITY_NEW_TASK,不要使用这个标记,除非你要实现你自己的顶层应用启动器
     
     </strong>  Used in conjunction with
     * {@link #FLAG_ACTIVITY_NEW_TASK} to disable the
     * behavior of bringing an existing task to the foreground. 
     结合FLAG_ACTIVITY_NEW_TASK可以实现禁止调用存在的后台任务进入前台的目的
     
      When set,
     * a new task is <em>always</em> started to host the Activity for the
     * Intent, regardless of whether there is already an existing task running
     * the same thing.
     当设置这个标记后,无论是否有已经存在的做相同事情的任务,始终新建新的任务来容纳Acitvity
     
     *
     * <p><strong>Because the default system does not include graphical task management,
     * you should not use this flag unless you provide some way for a user to
     * return back to the tasks you have launched.</strong>
     由于默认系统没有包含图形化的任务管理器,不建议使用这个标记,除非提供某种方式让用户能够返回你已经启动的相关任务
     
     *
     * See {@link #FLAG_ACTIVITY_NEW_DOCUMENT} for details of this flag's use for
     * creating new document tasks.
     参考FLAG_ACTIVITY_NEW_DOCUMENT链接,来获取更多创建新文档任务的使用说明
     
     *
     * <p>This flag is ignored if one of {@link #FLAG_ACTIVITY_NEW_TASK} or
     * {@link #FLAG_ACTIVITY_NEW_DOCUMENT} is not also set.
     不与FLAG_ACTIVITY_NEW_DOCUMENT、FLAG_ACTIVITY_NEW_TASK任意一个合用,这个标记将会失效
     
     *
     * <p>See
     * <a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back
     * Stack</a> for more information about tasks.
     参考链接任务链和回退栈,获取更多关于任务链的信息
     *
     * @see #FLAG_ACTIVITY_NEW_DOCUMENT
     * @see #FLAG_ACTIVITY_NEW_TASK
     */

 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值