当前位置:网站首页>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
- jvm: 方法重载时,具体调用哪个方法,是由传入参数的静态类型来决定的,而不是由参数的实际类型来决定
- 如何指定pig-register项目日志的输出路径
- Opencv display image
- True MySQL interview question (XXII) -- condition screening and grouping screening after table connection
- The traditional Internet like platform may no longer exist, and a new industry integrating industrial characteristics and Internet characteristics
- Digital collections - new investment opportunities
- visdom的使用
- MySQL面试真题(二十一)——金融-贷款逾期
- Wechat applet: production and generation of love guarantee
猜你喜欢

Wechat applet: an artifact for calculating the full amount of orders

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

Deploy docker and install MySQL in centos7

Lottery DDD code

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

Huawei's software and hardware ecosystem has taken shape, fundamentally changing the leading position of the United States in the software and hardware system

android Handler内存泄露 kotlin内存泄露处理

MySQL面试真题(三十)——贝壳-房产订单分析

MySQL面试真题(二十三)——拼多多-球赛分析

C primer plus學習筆記 —— 2、常量與格式化IO(輸入/輸出)
随机推荐
新课上线 | 每次 5 分钟,轻松玩转阿里云容器服务!
使用链表实现两个多项式相加和相乘
What is the magic of digital collections? Which reliable teams are currently developing
jvm-05.垃圾回收
C primer plus学习笔记 —— 2、常量与格式化IO(输入/输出)
Mobile phone wireless charging dual coil 15W scheme SOC IC ip6809
PAT 乙等 1013 C语言
jvm-06.垃圾回收器
PAT 乙等 1020.月饼
Pit filling for abandoned openssl-1.0.2 (.A to.So)
Leetcode topic analysis: factorial training zeroes
[graduation season u; advanced technology Er] farewell to the confused self in the past two years. Regroup, junior I'm coming
Yingjixin launched 4 series of lithium batteries 100W mobile power supply voltage rise and fall scheme SOC chip ip5389
Oracle exception
Wechat applet: Star Trek spaceship ticket production and generation
Heimdall Database Proxy横向扩展提高20倍
MySQL面试真题(二十三)——拼多多-球赛分析
MySQL面试真题(三十)——贝壳-房产订单分析
数字藏品——新的投资机遇
[image fusion] sparse regularization based on non convex penalty to realize image fusion with matlab code




