zoukankan      html  css  js  c++  java
  • 后台运行 程序

    项目要求

    应用启动时,有A B C 三个ACTIVITY 进到A B C任何一个activity 按下home键,程序在后台运行,当恢复应用的时候,应用显示之前被按下home键的那个页面。

    可以查到官方文档:

     moveTaskToBack(true);

    官方给出的说明是:

    Move the task containing this activity to the back of the activity stack. The activity's order within the task is unchanged.

    Parameters:
    nonRoot If false then this only works if the activity is the root of a task; if true it will work for any activity in a task.
    Returns:
    If the task was moved (or it was already at the back) true is returned, else false.

     也就是说 将包含actvity的任务放到 activity的栈顶,但是在栈任务里面的顺序不会改变

    参数说明:

      当值为false的时候,只在当前的activity是栈任务的根才起作用,当值为ture的时候,栈任务里面的任何一个activity都起作用。

    返回

        如果任务呗移动的(或者已经在栈顶了),返回ture,否则返回false。

  • 相关阅读:
    用户场景描述
    构建之法阅读笔记03
    冲刺记录(4.26)
    力扣-dp基础问题思维构建
    力扣-二叉树专题
    力扣-巧妙哈希
    力扣-双指针问题
    力扣-区间问题
    力扣-单调栈与单调队列问题
    力扣-股票买卖专题
  • 原文地址:https://www.cnblogs.com/xilinch/p/2670020.html
Copyright © 2011-2022 走看看