Android developers face questions of activity life cycle

Activity life cycle:

Open Activity:

onCreate =>onStart =>onResume

Then press the home key to return to the desktop:

onPause =>onStop

Enter the activity again:

onRestart=>onStart=>onResume

 

Could we have another complete

onCreate=>onStart =>onResume

=>onPause=>onStop 

=>onRestart =>onStart=>onResume

 

 

Exit activity life cycle:

onPause=>onStop=>onDestory

 

Come complete:

activity start: onCreate => onStart => onResume
press the Home activity: onPause => onStop
return to activity: onReStart => onStart => onResume
exit activity: onPause => onStop => onDestory

 

He published 191 original articles · won praise 105 · views 360 000 +

Guess you like

Origin blog.csdn.net/xiayiye5/article/details/95673509