当前位置:网站首页>View handler stepping record
View handler stepping record
2022-08-05 02:30:00 【It's comfortable to eat】
Questions
After the view executes onDetachedFromWindow, the view instance will still exist, but the handler in the view will be empty. When the handler in the view is used, an empty judgment needs to be made
Principle
The handler of the view is obtained through view.getHandler(), as shown in the figure below, the handler is obtained from mAttachInfo, mAttachInfo is assigned in dispatchAttachedToWindow, and empty in dispatchDetachedFromWindow, where dispatchAttachedToWindow will call the view's onAttachedToWindow, and dispatchDetachedFromWindow will call the view's onAttachedToWindowonDetachedFromWindow.



Conclusion
So first of all, we need to remove the handler's runnable or callback in the view's onDetachedFromWindow. At other times when the handler is used, the handler needs to make a short judgment.
边栏推荐
- C student management system Insert the student node at the specified location
- 【C语言】详解栈和队列(定义、销毁、数据的操作)
- js中try...catch和finally的用法
- 【存储】曙光存储DS800-G35 ISCSI各映射LUN给服务器
- [深入研究4G/5G/6G专题-51]: URLLC-16-《3GPP URLLC相关协议、规范、技术原理深度解读》-11-高可靠性技术-2-链路自适应增强(根据无线链路状态动态选择高可靠性MCS)
- Short domain name bypass and xss related knowledge
- iNFTnews | What can NFTs bring to the sports industry and fans?
- C student management system Find student nodes based on student ID
- Leetcode刷题——22. 括号生成
- 散列表的查找(哈希表)
猜你喜欢

剑指offer专项突击版第20天

线性表的查找

Advanced Numbers_Review_Chapter 1: Functions, Limits, Continuity

Leetcode刷题——22. 括号生成

C language implements a simple number guessing game

KingbaseES V8 GIS data migration solution (2. Introduction to the capabilities of Kingbase GIS)

HOG feature study notes

没有对象的程序员如何过七夕

在这个超连接的世界里,你的数据安全吗

Programmer's list of sheep counting when insomnia | Daily anecdote
随机推荐
【日常训练】1403. 非递增顺序的最小子序列
2022-08-04:输入:去重数组arr,里面的数只包含0~9。limit,一个数字。 返回:要求比limit小的情况下,能够用arr拼出来的最大数字。 来自字节。
Domain Driven Design - MDD
Introduction to SDC
如何逐步执行数据风险评估
基于OpenVINO工具套件简单实现YOLOv7预训练模型的部署
shell语句修改txt文件或者sh文件
C language basics -- pointers
Dotnet 6 Why does the network request not follow the change of the system network proxy and dynamically switch the proxy?
Unleashing the engine of technological innovation, Intel joins hands with ecological partners to promote the vigorous development of smart retail
RAID磁盘阵列
【genius_platform软件平台开发】第七十六讲:vs预处理器定义的牛逼写法!!!!(其他组牛逼conding人员告知这么配置来取消宏定义)
转:查尔斯·汉迪:你是谁,比你做什么更重要
Oracle encapsulates restful interfaces into views
Programmer's list of sheep counting when insomnia | Daily anecdote
从零到一快速学会三子棋
02 [Development Server Resource Module]
".NET IoT from scratch" series
The 2022 EdgeX China Challenge will be grandly opened on August 3
协作D2D局部模型聚合的半分散联合学习