当前位置:网站首页>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 )

边栏推荐
- Wechat applet; AI intelligent dubbing assistant
- AHA C language Chapter 8 game time is up (lesson 29)
- MySQL面试真题(二十七)——RFM分析法对用户进行分类
- 【数据库备份】通过定时任务完成MySQL数据库的备份
- TCP/IP 详解(第 2 版) 笔记 / 3 链路层 / 3.4 网桥与交换机
- PAT 乙等 1010 C语言
- ORB_ Slam2 operation
- PAT 乙等 1023 组个最小数
- [OWT] OWT client native P2P E2E test vs2017 build 6: modify script automatic generation vs Project
- Leetcode topic resolution divide two integers
猜你喜欢

MySQL面试真题(二十七)——RFM分析法对用户进行分类

sprintf 格式代码使用不规范在不同平台下的表现

Wechat applet: unfashionable love talk

MySQL面试真题(二十五)——常见的分组比较场景

Genetic engineering of AI art? Use # artbreeder to change any shape of the image

Behind the hot digital collections, a strong technical team is needed to support the northern technical team

True MySQL interview question (21) - Finance - overdue loan

数字藏品如何赋能经济实体?

jvm-04.对象的内存布局

【owt】owt-client-native-p2p-e2e-test vs2017构建 6:修改脚本自动生成vs工程
随机推荐
数字藏品市场才刚刚开始
MDM data cleaning function development description
Real MySQL interview questions (25) -- common group comparison scenarios
AHA C language Chapter 7 you can do more with it (talks 27-28)
ORB_ Slam2 operation
Skill self check | do you know these 6 skills if you want to be a test leader?
How does win11 enable mobile hotspot? How to enable mobile hotspot in win11
PAT 乙等 1013 C语言
知识点滴 - 折叠锻打和大马士革钢
Wechat applet: an artifact for calculating the full amount of orders
Yingjixin ip5566 with type-C port 3A charging and discharging fast charging mobile power supply 5W wireless charging in one SOC
PAT 乙等 1025 反转链表
[OWT] OWT client native P2P E2E test vs2017 build 6: modify script automatic generation vs Project
Redis cache penetration solution - bloom filter
visdom的使用
jvm-06.垃圾回收器
最优传输理论下对抗攻击可解释性
The official artifact of station B has cracked itself!
ssm项目搭建
sprintf 格式代码使用不规范在不同平台下的表现




