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

边栏推荐
- Leetcode topic analysis: factorial training zeroes
- Arctime makes Chinese and English subtitle video
- PAT 乙等 1014 C语言
- Prometheus, incluxdb2.2 installation and flume_ Export download compile use
- 三项最高级认证,两项创新技术、两大优秀案例,阿里云亮相云原生产业大会
- Explanation of penetration test process and methodology (Introduction to web security 04)
- 雷达图canvas
- C prime plus notes d'apprentissage - 2, constantes et formatage io (I / o)
- jvm: 方法重载时,具体调用哪个方法,是由传入参数的静态类型来决定的,而不是由参数的实际类型来决定
- True MySQL interview question (24) -- row column exchange
猜你喜欢

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

True question of MySQL interview (29) -- case - finding favorite movies

数字藏品火热背后需要强大的技术团队支持 北方技术团队

Centos7 installation of postgresql8.2.15 and creation of stored procedures

Dolphin scheduler dolphin scheduling upgrade code transformation -upgradedolphin scheduler

如何指定pig-register项目日志的输出路径

Raspberry pie assert preliminary exercise

Data migration from dolphin scheduler 1.2.1 to dolphin scheduler 2.0.5 and data test records after migration

Deploy docker and install MySQL in centos7

MySQL面试真题(二十四)——行列互换
随机推荐
JS interview question - anti shake function
Alibaba cloud object storage oss+picgo+typera implements the construction map
Excel sheet column title for leetcode Title Resolution
AI艺术的基因工程?使用 #Artbreeder 改变图像的任意形态
Low cost 5W wireless charger scheme fs68001b simple charging chip
Dolphin scheduler dolphin scheduling upgrade code transformation -upgradedolphin scheduler
最优传输理论下对抗攻击可解释性
Genetic engineering of AI art? Use # artbreeder to change any shape of the image
Yingjixin launched 4 series of lithium batteries 100W mobile power supply voltage rise and fall scheme SOC chip ip5389
jvm-06.垃圾回收器
Centos7 installation of postgresql8.2.15 and creation of stored procedures
[Stanford Jiwang cs144 project] lab2: tcpreceiver
HierarchyViewer工具找不到 HierarchyViewer位置
PAT 乙等 1016 C语言
MySQL面试真题(二十二)——表连接后的条件筛选及分组筛选
Visdom draws multiple dynamic loss curves
jvm: 方法重载时,具体调用哪个方法,是由传入参数的静态类型来决定的,而不是由参数的实际类型来决定
Redis cache penetration solution - bloom filter
The performance of nonstandard sprintf code in different platforms
iNFTnews | 加密之家从宇宙寄来的明信片,你会收到哪一张?




