当前位置:网站首页>Activity的四种状态
Activity的四种状态
2022-08-11 06:44:00 【是小A】
一个Activity实质上有四种状态:运行,暂停,停止,销毁
运行中:
在屏幕前台(位于当前任务堆栈的顶部)
此时的Activity位于栈顶,是可见的,并且可以与用户进行交互
暂停:
失去焦点,但仍然对用户可见(覆盖Activity可能是透明或未完全遮挡)
当Activity失去焦点,不能与用户交互了,但依然可见,就处于暂停状态
当一个新的非全屏的Activity或者一个透明的Activity放置在栈顶,Activity就处于暂停状态;
这个时候Activity的各种数据仍然保存着;
只有在系统内存极低的情况下,系统才会自动的销毁Activity
停止:
完全被另一个Activity覆盖
当一个Activity被另一个Activity完全覆盖,或者点击HOME键 退入了后台,这时候的Activity处于停止状态
此时的Activity的各种数据仍然保存着
当系统别的地方需要用到内容时,系统会自动的去销毁Activity
销毁:
退出,完全销毁
当我们点击返回键或者系统在内存不够用的情况下就会把Activity从栈里移除并销毁,被系统回收,这时候Activity就处于销毁状态
边栏推荐
- How Unity programmers can improve their abilities
- How Unity handles C# under the hood
- Redis源码:Redis源码怎么查看、Redis源码查看顺序、Redis外部数据结构到Redis内部数据结构查看源码顺序
- Daily sql - judgment + aggregation
- Do not add the is prefix to the variables of the boolean type in the POJO class of the Alibaba specification
- Redis测试
- 数仓开发知识总结
- LeetCode brushing series -- 46. Full arrangement
- 国密规范 SM2 SM3 SM4
- Internet phone software or consolidation of attack must be "free" calls security clearance
猜你喜欢

结合均线分析k线图的基本知识

Daily sql-employee bonus filtering and answer rate ranking first

MySQL 版本升级心得

拼多多API接口大全

Spatial Pyramid Pooling -Spatial Pyramid Pooling (including source code)

Daily sql-seek the sum of successful investments in 2016

DDR4内存条电路设计

Douyin API interface

Taobao API interface reference

Taobao product details API interface
随机推荐
微信小程序功能上新(2022.06.01~2022.08.04)
Amazon API interface Daquan
Unity游戏排行榜的制作与优化
buu—Re(5)
详述 MIMIC护理人员信息表(十五)
golang fork 进程的三种方式
如何选择专业、安全、高性能的远程控制软件
1688 product interface
Daily sql - judgment + aggregation
Internet phone software or consolidation of attack must be "free" calls security clearance
daily sql - user retention rate for two days
Waldom Electronics宣布成立顾问委员会
Do not add the is prefix to the variables of the boolean type in the POJO class of the Alibaba specification
2022-08-09 第四小组 修身课 学习笔记(every day)
sql--7天内(含当天)购买次数超过3次(含),且近7天的购买金额超过1000的用户
Douyin API interface
How do you optimize the performance of your Unity project?
每日sql -查询至少有5名下属的经理和选举
How Unity handles C# under the hood
Douyin share password url API tool