当前位置:网站首页>In an activity, view postdelay will cause memory leakage, but will not affect the life cycle execution of the activity.
In an activity, view postdelay will cause memory leakage, but will not affect the life cycle execution of the activity.
2022-06-11 07:55:00 【tinyvampirepudge】
Activity in ,View#postDelay Memory leaks can result , But it won't affect Activity Life cycle execution of .
The test code is as follows :
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.e(TAG, "onCreate");
iv = findViewById(R.id.iv);
iv.postDelayed(new Runnable() {
@Override
public void run() {
Log.e(TAG, " I am a delay message ");
}
}, 10000);
}
@Override
protected void onPause() {
super.onPause();
Log.e(TAG, "onPause");
}
@Override
protected void onStop() {
super.onStop();
Log.e(TAG, "onStop");
}
@Override
protected void onDestroy() {
super.onDestroy();
Log.e(TAG, "onDestroy");
}
log as follows :
2021-05-07 20:37:06.234 14974-14974/com.tinytongtong.androidstudy E/GlideV4Activity: onCreate
2021-05-07 20:37:07.844 14974-14974/com.tinytongtong.androidstudy E/GlideV4Activity: onPause
2021-05-07 20:37:08.245 14974-14974/com.tinytongtong.androidstudy E/GlideV4Activity: onStop
2021-05-07 20:37:08.249 14974-14974/com.tinytongtong.androidstudy E/GlideV4Activity: onDestroy
2021-05-07 20:37:16.304 14974-14974/com.tinytongtong.androidstudy E/GlideV4Activity: I am a delay message
边栏推荐
- C. Manipulating History(贪心/哈希/思维/好题)
- 【案例解读】医疗单据OCR识别助力健康险智能理赔
- JSP technology: JSP overview, JSP basic syntax, JSP instructions, JSP implicit objects, JSP action elements
- Three expressions of integers and their storage in memory
- 860. lemonade change
- TypeScript-接口和类型别名异同
- Tidb Cloud est en ligne sur le marché Google Cloud pour permettre aux développeurs du monde entier d'utiliser une nouvelle pile de bases de données htap en temps réel
- Pycrypto packaging error
- Alchemy experience (model training of deep learning) the necessity of timely adjusting training parameters for some situations (the adjustment of learning rate LR is the primary) summarizes some metho
- [IOT] project management: how to build a better cross functional team?
猜你喜欢

Use of wordcloud

A detailed explanation of one of the causes of dead loop caused by array out of bounds in C language

Qunhui ds918 creates m.2 SSD read / write cache

How to prepare for the new PMP syllabus exam?

C language to achieve three piece chess (not artificial mental retardation ha ha ha)

Image data enhancement (translation, rotation, brightness transformation, flipping, adding Gaussian noise, scaling, cropping)

Summary of evaluation index knowledge points in target detection: summary of IOU cross overlap unit and map/ap/tp/fp/np

C language - growth diary-04- preliminary exploration of local variables (local variables)

Tutoriel de démarrage bladed (vidéo)

Paging of the flask page
随机推荐
String Simulation Implementation
2. Graduated from this course, and the bank has outsourced testing work for more than 4 months. Talk about some real feelings
Request request object and response response object
记一次忽略@SuppressLint(“NewApi“)提示引发的血案
避免list的并发修改异常的几种方式
Semiconductor memory classification
Long dialogue in June 2017
Understanding of Poisson distribution and Poisson process and Erlang distribution and their relations (important theories in queuing theory and operational research)
Note: JDBC
2021-10-17
TypeScript-类型保护
multi-sig SC
134. gas station
Activity中,View#postDelay会导致内存泄漏,但是不会影响Activity的生命周期执行。
Login and parameterization of interface test
[codeforces1019e] raining season
What exactly is PMP?
Scrape captures 51job Recruitment Information (static page)
[the most complete ENSP [installation diagram] in history!]
C- print 99 multiplication table