zoukankan      html  css  js  c++  java
  • The behavior of App killed or restored by Android System or by users

    What's the behavior of App killed or restored by Android System or by users?


    First, user kills the app by swiping out the screen

    The DEMO process is killed and activity stack is cleared. And the system will relaunch the DEMO process automatically.  When user launch the app, it will just likes user taps App icon in home screen.

    Second, user force to stop the app on the app information page

    The DEMO process is killed and activity stack is cleared. When user launches the app,  it will just likes user taps App icon in home screen.

    Third,Killed/restored by system when there’s insufficient memory.

    Two behaviours,

    1. If DEMO app is running in background (press home button to move DEMO task to background).

     For example, go to about -> what’s new , stay in what’s new screen, then press the home menu to move DEMO app to background, the activity stack is:

     TaskRecord{671c710 #129 A=com.demo.android U=0sz=3}

            Run #7: ActivityRecord{1f2503f6 u0com.demo.android/.whatsnew.WhatsNewActivity t129}

            Run #6: ActivityRecord{10cbd46 u0com.demo.android/.settings.About t129}

            Run #5: ActivityRecord{867b18f u0com.demo.android/.main t129}

    Then kill the DEMO process, system will relaunch the DEMO process automatically, but the activity stack does not be restored, the task record is empty,

    TaskRecord{671c710 #129 A=com.demo.android U=0 sz=3}

    Then  relaunch the DEMO app from launcher, the task record is:

         TaskRecord{671c710 #129 A=com.demo.android U=0 sz=4}

            Run #5: ActivityRecord{229cb1f7 u0com.demo.android/.main t129}

         

    We see here system will launch the root activity (main)instead of keep the last activity (WhatsNewActivity). 


    2. If DEMO app is running, and switch to other app from notification. 

    Follow the same flow of case 1. Keep in what’s new screen:

    TaskRecord{671c710 #129 A=com.demo.android U=0 sz=3}

            Run #7: ActivityRecord{69eb835 u0com.demo.android/.whatsnew.WhatsNewActivity t129}

            Run #6: ActivityRecord{2ca853c5 u0com.demo.android/.settings.About t129}

            Run #5: ActivityRecord{867b18f u0com.demo.android/.main t129}

    Kill DEMO app, system will relaunch the demo process automatically.Press back key to return DEMO app.

    TaskRecord{671c710 #129 A=com.demo .android U=0 sz=3}

            Run #5: ActivityRecord{69eb835 u0com.demo.android/.whatsnew.WhatsNewActivity t129}

    We see here we still stay in the What’s new screen, press back will back to about screen. System will restore the activity stack. However,because the new process lose all global data, such as auth status, and otherdata in memory, so the DEMO will be in a wrong status. 

    Finally,I trigger the scenario  "system is lack of memory", and we can learn that  Both UI process and Service process of DEMO app killed /restored bysystem when in low memory, and the activity stack will be empty, once it restored by system, it just likes user taps demo app icon in home screen.




  • 相关阅读:
    转:SLAM算法解析:抓住视觉SLAM难点,了解技术发展大趋势
    在ROS系统下,获取tango的RGBD信息和Pose信息
    ubuntu更改源为aliyun的源;ROS改为新加坡源
    PCL学习(五)如何在mesh模型上sample更多点及三维物体姿态估计
    利用StringBuffer向字符串特定的重复子字符串插入数据
    poi做Excel数据驱动,支持.xls和.xlsx格式的excel文档,比起jxl强大不少
    selenium grid的使用与配置
    maven下载,安装与eclipse中maven配置
    Webdriver实现对菜单栏的灵活切换功能,附上代码,类似的菜单栏切换可以自己封装
    Webdriver控制翻页控件,并实现向前向后翻页功能,附上代码,仅供参考,其他类似日期控件的功能可以自己封装
  • 原文地址:https://www.cnblogs.com/yjbjingcha/p/7063911.html
Copyright © 2011-2022 走看看