当前位置:网站首页>Activity startup mode and life cycle measurement results
Activity startup mode and life cycle measurement results
2022-06-23 05:53:00 【Muzi 102】
I am often asked by the interviewer during the interview activity Life cycle problems , However, we usually only have a brief understanding of the common , While the interviewer is always asking about the life cycle of exotic situations , So I wrote a demo, Carefully check the real situation and the results ( The most embarrassing thing is that the interviewer said , Go back and try )

Activity Boot mode
standard: Create everything ( Default startup mode )
singleTop: Not on top target Activity,new One
singleTask: Not on top target Activity, remove target Above , Turn yourself into top.
singleInstance: Open up private task, Other completely independent of the program activity Of task.
standard Pattern
One 、 Under normal circumstances, start a activity, Its life cycle :(Activity_A Do a test )
1、 start-up ->back Key returns :
onCreat()->onStart()->onResume()->onPause()->onStop()->onDestroy()
2、 start-up ->home desktop -> And on again app( Without being killed ):
onCreat()->onStart()->onResume()->onPause()->onStop()->onRestart()->onStart()->onResume()
singleTop Pattern
One 、 Under normal circumstances, start a activity, Its life cycle :(Activity_B Do a test )
1、 start-up ->back Key returns : The result is the same as standard Pattern
2、 start-up ->home desktop -> And on again app( Without being killed ): The result is the same as standard Pattern
3、 Already on top , Start your situation again :
onCreat()->onStart()->onResume()->onPause()->onNewIntent()->onResume()->onPause()->onStop()->onDestroy()
4. There are already... In the stack , But not at the top :
singleTask Pattern
One 、 Under normal circumstances, start a activity, Its life cycle :(Activity_B Do a test )
1、 start-up ->back Key returns : The result is the same as standard Pattern
2、 start-up ->home desktop -> And on again app( Without being killed ): The result is the same as standard Pattern
3、 Already on top , Start your situation again : The result is the same as singleTop Pattern
4. There are already... In the stack , But not at the top :
singleInstance Pattern
One 、 Under normal circumstances, start a activity, Its life cycle :(Activity_B Do a test )
1、 start-up ->back Key returns : The result is the same as standard Pattern
2、 start-up ->home desktop -> And on again app( Without being killed ): The result is the same as standard Pattern
3、 Already on top , Start your situation again : The result is the same as singleTop Pattern4. There are already... In the stack , But not at the top : The result is the same as singleTask Pattern
Activity A start-up B Then return A A and B Life cycle changes of ( The order )

边栏推荐
- C primer plus学习笔记 —— 2、常量与格式化IO(输入/输出)
- Wechat applet: Star Trek spaceship ticket production and generation
- 制造业数字化转型存在问题及原因分析
- 华为软硬件生态圈成型,从根子上改变美国对软硬件体系的领导地位
- Low cost 5W wireless charger scheme fs68001b simple charging chip
- 【斯坦福计网CS144项目】Lab2: TCPReceiver
- The 510000 prize pool invites you to participate in the competition -- the second Alibaba cloud ECS cloudbuild developer competition is coming
- jvm-01.指令重排
- C primer plus學習筆記 —— 2、常量與格式化IO(輸入/輸出)
- Wechat applet: a new interesting test
猜你喜欢

Yingjixin ip6806 wireless charging scheme 5W Qi certified peripheral simplified 14 devices

Skill self check | do you know these 6 skills if you want to be a test leader?

runc 符号链接挂载与容器逃逸漏洞预警(CVE-2021-30465)

Wechat applet; AI intelligent dubbing assistant

数字藏品赋能实体产业释放了哪些利好?
![[proteus simulation] Arduino uno+pcf8574+lcd1602+mpx4250 electronic scale](/img/2d/96a370c90dcb7091038afad33bc4b4.png)
[proteus simulation] Arduino uno+pcf8574+lcd1602+mpx4250 electronic scale

数字藏品市场才刚刚开始

Real MySQL interview questions (XXVI) -- didi 2020 written examination questions

Kotlin android简单Activity跳转、handler和thread简单配合使用

Activity启动模式和生命周期实测结果
随机推荐
What does the English letter PC mean? What does the Internet PC mean
Management system of borrowed books based on SSM framework
PAT 乙等 1017 C语言
制造业数字化转型存在问题及原因分析
PAT 乙等 1021 个位数统计
数字藏品到底有什么魔力?目前有哪些靠谱的团队在开发
Huawei's software and hardware ecosystem has taken shape, fundamentally changing the leading position of the United States in the software and hardware system
阿里云 ACK One、ACK 云原生 AI 套件新发布,解决算力时代下场景化需求
MySQL面试真题(二十八)——案例-通讯运营商指标分析
What benefits have digital collections enabled the real industry to release?
C primer plus学习笔记 —— 2、常量与格式化IO(输入/输出)
树莓派assert初步使用练习
MySQL面试真题(二十四)——行列互换
数字藏品市场才刚刚开始
Leetcode topic analysis add binary
visdom画多条动态损失曲线
TCP/IP 详解(第 2 版) 笔记 / 3 链路层 / 3.3 全双工, 节能, 自动协商机制, 802.1X 流控制 / 3.3.3 链路层流量控制
MySQL character set
What is the magic of digital collections? Which reliable teams are currently developing
C prime plus notes d'apprentissage - 2, constantes et formatage io (I / o)



