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.
The behavior of App killed or restored by Android System or by users的更多相关文章
- [Tool] 取得APP的Store URL Scheme (Android、iOS)
[Tool] 取得APP的Store URL Scheme (Android.iOS) 前言 在企业网站中,如果希望使用URL连结的方式,开启Store APP来下载APP(非网页下载).开发人员可以 ...
- 命令行下使用javah命令生成.h文件,出现“错误: 无法访问android.app.Activity 找不到android.app.Activity的类文件”的解决方法
在学习NDK中,当我在项目的bin/classes目录下使用javah命令生成头文件时,出现了“错误: 无法访问android.app.Activity 找不到android.app.Activity ...
- 【转】can't find referenced method 'android.app.RemoteInput[] getRemoteInputs()' in class android.app.Notification$Action
原文网址:http://stackoverflow.com/questions/25508735/cant-find-referenced-method-android-app-remoteinput ...
- 微信授权登陆接入第三方App(步骤总结)Android
微信授权登陆接入第三方App(步骤总结)Android Android App实现第三方微信登录
- wemall app商城源码中android按钮的三种响应事件
wemall-mobile是基于WeMall的android app商城,只需要在原商城目录下上传接口文件即可完成服务端的配置,客户端可定制修改.本文分享wemall app商城源码中android按 ...
- 写给Android App开发人员看的Android底层知识(8)
(十)PMS及App安装过程 PMS,全称PackageManagerService,是用来获取Apk包的信息的. 在前面分析四大组件与AMS通信的时候,我们介绍过,AMS总是会使用PMS加载包的信息 ...
- Windows Phone App的dump文件实例分析- System.ExecutionEngineException
前言 在开始这篇文章之前我们先来讲讲如何从高度优化的Release版的Dump中找到正确的异常上下文地址,并手动恢复异常发生的第一现场. 1. 什么是异常上下文 简单来说,在windows体系的操作系 ...
- 将报表移动端集成到自有移动端app方法【IOS、Android】
应用场景 用户有自己的app,希望把报表的移动端[本文中以FineReport移动端为例]功能集成到他们的app里面去,而不需要安装两个app.Android端和IOS端的集成接口是不一样的,下面我们 ...
- 仿各种APP将文章DOM转JSON并在APP中以列表显示(android、ios、php已开源)
背景 一直以来都想实现类似新闻客户端.鲜城等文章型app的正文显示,即在web editor下编辑后存为json,在app中解析json并显示正文. 网上搜过,没找到轮子.都是给的思路,然后告知是公司 ...
随机推荐
- es6 -- set 数据结构
ES6 提供了新的数据结构 Set.它类似于数组,但是成员的值都是唯一的,没有重复的值. Set 本身是一个构造函数,用来生成 Set 数据结构. const s = new Set(); [2, 3 ...
- kali之EtterCap学习
EtterCap是一个基于ARP地址欺骗方式的网络嗅探工具,主要适用于交换局域网络.借助于EtterCap嗅探软件,渗透测试人员可以检测网络内明文数据通讯的安全性,及时采取措施,避免敏感的用户名/密码 ...
- last---显示用户最近登录信息
last命令用于显示用户最近登录信息.单独执行last命令,它会读取/var/log/wtmp的文件,并把该给文件的内容记录的登入系统的用户名单全部显示出来. 语法 last(选项)(参数) 选项 - ...
- [Angular & Unit Testing] TestBed.get vs Injector
Both what "TestBed.get" & "injector" trying to do is get service for the tes ...
- 细说 iOS 消息推送
APNS的推送机制 与Android上我们自己实现的推送服务不一样,Apple对设备的控制很严格.消息推送的流程必需要经过APNs: 这里 Provider 是指某个应用的Developer,当然假设 ...
- android抓取各种log的方法
1.logcat (四类log buffer是main,radio.system.events) adb wait-for-device logcat adb logcat -v time > ...
- vue ---webpack 打包上线
先来描述一下期间遇到的问题有哪些: 1.打包后将 dist 文件夹和 index.html 放到 tomcat,在浏览器中访问时,出现空白页,f12 提示 404. 2.打包好的静态资源均是绝对路径 ...
- win7旗舰版怎么降级到专业版
一.操作准备及注意事项 1.UltraISO光盘制作工具9.5 2.备份C盘及桌面文件 二.win7旗舰版改成专业版的步骤 1.当前系统为Win7 SP1 64位旗舰版: 2.按Win+R打开运行,输 ...
- php基础篇之一
1.PHP是什么 官方文档:超文本预处理器 2.PHP能够做一些什么? PHP主要应用在一下领域: (1)服务器端脚本,需要:PHP解析器,PHP服务器,PHP浏览器. (2)命令行脚本,只需要PHP ...
- PYTHON学习第五天课后总结:
今日重点: 数字类型 字符串类型 列表类型 元组类型 1,数字类型 数字类型为不可变类型 也只能将纯数字类型的字符串转换成int包括: 整型: int() int() 为内置函数,可 ...