A brief explanation of Android's activity life cycle

An activity page
activity: start to end
onCreat create
onStart start page is visible, but not interactive, interaction is to touch
onResume to restart, resume page is visible, interactive, you can touch
onPause to pause the page is visible, can not touch
onStop stop page is not visible Added
onDestory to destroy and recycle

Start stage End stage
onCreat: page creation onDestory: page destruction
onStart: page is visible, but cannot interact onStop: page is not visible
onResume: page is visible and interactive onPase: page is visible and cannot be interacted

onCreat: write some control data initialization work in it
onPause: save some small data (it is not recommended to affect the opening speed of the next page)
onDestory: do some finishing work, save data, log off some service threads and so on

Guess you like

Origin blog.csdn.net/ShiXinXin_Harbour/article/details/127383649