当前位置:网站首页>Four startup modes of Activity
Four startup modes of Activity
2022-08-11 07:51:00 【is a small A】
One.standard:
The default startup mode of the system, stack structure, first in, last out, open an activity and push it into the stack, then open the next activity, and then push into the stack. The activities we usually create directly are all activities in this mode
The characteristics of Activity in this mode are: as long as you create an Activity instance, once the Activity is activated, the newly created instance will be added to the task stack, and if you exit the Activity, the instance will be destroyed in the task stack.
two.singleTop:
If an Activity activates itself, that is, the top of the task stack is the Activity, it does not need to be created, and an Activity instance must be created in other cases;
Three.singleTask:
If the instance of the Activity to be activated exists in the task stack, you don't need to create it. You only need to put the Activity on the top of the stack, and pop all Activity instances above the Activity;
four.singleInstance:
If we set an activity to this singleStance startup mode, then when the activity is activated, it will be placed on a separate stack, and the next time it is used, the stack will be used directly. For example, the calling application is started in a singleStance mode.activity
There are two ways to implement the code
The first one configures the desired startup mode in AndroidMainfest
The second configuration is in Java code
Intent intent = new Intent(MainActivity.this,SecondActivity.class);intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);// do logic processing herestartActivity(intent);
边栏推荐
- How Unity programmers can improve their abilities
- 3GPP LTE/NR信道模型
- 1071 小赌怡情 (15 分)
- SQL滑动窗口
- tf.reduce_mean()与tf.reduce_sum()
- 公牛10-11德里克·罗斯最强赛季记录
- 【latex异常和错误】Missing $ inserted.<inserted text>You can‘t use \spacefactor in math mode.输出文本要注意特殊字符的转义
- Unity3D 学习路线?
- Unity游戏排行榜的制作与优化
- Evolution and New Choice of Streaming Structured Data Computing Language
猜你喜欢
随机推荐
CIKM 2022 AnalytiCup Competition: 联邦异质任务学习
JRS303-数据校验
TF中的条件语句;where()
【LaTex-错误和异常】\verb ended by end of line.原因是因为闭合边界符没有在\verb命令所属行中出现;\verb命令的正确和错误用法、verbatim环境的用法
Tensorflow中使用tf.argmax返回张量沿指定维度最大值的索引
1061 判断题 (15 分)
2022-08-09 Group 4 Self-cultivation class study notes (every day)
公牛10-11德里克·罗斯最强赛季记录
oracle19c does not support real-time synchronization parameters, do you guys have any good solutions?
Tf中的平方,多次方,开方计算
tf中自减操作;tf.assign_sub()
1.1-回归
Production and optimization of Unity game leaderboards
软件测试主要做什么工作,难不难?
Dynamic Agent Learning
Strongly recommend an easy-to-use API interface
【LeetCode每日一题】——682.棒球比赛
Item 2 - Annual Income Judgment
1071 小赌怡情 (15 分)
TF中的One-hot