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

边栏推荐
- MySQL面试真题(二十三)——拼多多-球赛分析
- visdom画多条动态损失曲线
- June 22, 2022: golang multiple choice question, what does the following golang code output? A:3; B:1; C:4; D: Compilation failed. package main import ( “fmt“ ) func mai
- 使用链表实现两个多项式相加和相乘
- Deploy docker and install MySQL in centos7
- 华为软硬件生态圈成型,从根子上改变美国对软硬件体系的领导地位
- ORB_ Slam2 operation
- 最优传输理论下对抗攻击可解释性
- 数字化工厂建设可划分为三个方面
- 【owt】owt-client-native-p2p-e2e-test vs2017构建 6:修改脚本自动生成vs工程
猜你喜欢

What is the magic of digital collections? Which reliable teams are currently developing

The performance of nonstandard sprintf code in different platforms

C primer plus learning notes - 2. Constant and formatted IO (input / output)

True MySQL interview question (24) -- row column exchange

Wechat applet: production and generation of love guarantee

jvm-01.指令重排

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

jvm: 方法重载时,具体调用哪个方法,是由传入参数的静态类型来决定的,而不是由参数的实际类型来决定

Centos7部署radius服务-freeradius-3.0.13-15.el7集成mysql
![[graduation season u; advanced technology Er] farewell to the confused self in the past two years. Regroup, junior I'm coming](/img/04/3121514fcd8fcf1c939cbca7f4c67a.jpg)
[graduation season u; advanced technology Er] farewell to the confused self in the past two years. Regroup, junior I'm coming
随机推荐
True MySQL interview question (XXII) -- condition screening and grouping screening after table connection
Low cost 5W wireless charger scheme fs68001b simple charging chip
The traditional Internet like platform may no longer exist, and a new industry integrating industrial characteristics and Internet characteristics
Centos7部署radius服务-freeradius-3.0.13-15.el7集成mysql
树莓派assert初步使用练习
Real MySQL interview questions (XXVII) -- Classification of users by RFM analysis method
TCP/IP 详解(第 2 版) 笔记 / 3 链路层 / 3.4 网桥与交换机
What benefits have digital collections enabled the real industry to release?
Explanation of penetration test process and methodology (Introduction to web security 04)
Redis cache penetration solution - bloom filter
Leetcode topic analysis add binary
True MySQL interview question (21) - Finance - overdue loan
C primer plus学习笔记 —— 2、常量与格式化IO(输入/输出)
A bit of knowledge - folding forging and Damascus steel
iNFTnews | 加密之家从宇宙寄来的明信片,你会收到哪一张?
mysql字符集
PAT 乙等 1020.月饼
Activity启动模式和生命周期实测结果
JS interview question - anti shake function
Leetcode topic analysis: factorial training zeroes




