当前位置:网站首页>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);
边栏推荐
- 4.1 - Support Vector Machines
- 1003 我要通过 (20 分)
- 【sdx62】XBL设置共享内存变量,然后内核层获取变量实现
- 【latex异常和错误】Missing $ inserted.<inserted text>You can‘t use \spacefactor in math mode.输出文本要注意特殊字符的转义
- There may be fields that cannot be serialized in the abnormal object of cdc and sqlserver. Is there anyone who can understand it? Help me to answer
- Redis source code: how to view the Redis source code, the order of viewing the Redis source code, the sequence of the source code from the external data structure of Redis to the internal data structu
- 2022-08-10 mysql/stonedb-慢SQL-Q16-耗时追踪
- Edge 提供了标签分组功能
- Discourse's Close Topic and Reopen Topic
- tf中自减操作;tf.assign_sub()
猜你喜欢
随机推荐
进制转换间的那点事
Dynamic Agent Learning
1.2-误差来源
2.1-梯度下降
【LaTex-错误和异常】\verb ended by end of line.原因是因为闭合边界符没有在\verb命令所属行中出现;\verb命令的正确和错误用法、verbatim环境的用法
1.1-回归
1071 Small Gamble (15 points)
从苹果、SpaceX等高科技企业的产品发布会看企业产品战略和敏捷开发的关系
3.1-分类-概率生成模型
Service的两种状态形式
项目1-PM2.5预测
Redis源码:Redis源码怎么查看、Redis源码查看顺序、Redis外部数据结构到Redis内部数据结构查看源码顺序
CIKM 2022 AnalytiCup Competition: 联邦异质任务学习
2022-08-10 mysql/stonedb-慢SQL-Q16-耗时追踪
1003 I want to pass (20 points)
1101 How many times B is A (15 points)
linux 安装mysql服务报错
Tf中的平方,多次方,开方计算
tf.reduce_mean()与tf.reduce_sum()
1003 我要通过 (20 分)