0 votes
in Android Library by
Can you explain the difference between Android’s onCreate(), onStart(), onResume(), onPause(), onStop(), and onDestroy() lifecycle methods?

1 Answer

0 votes
by

Below are the  the difference between Android’s onCreate(), onStart(), onResume(), onPause(), onStop(), and onDestroy() lifecycle methods
onCreate(): Initializes activity, sets layout, and creates UI components. Called once.

onStart(): Activity becomes visible but not interactive yet. Prepares for user interaction. Can be called multiple times.

onResume(): Activity is in the foreground and fully interactive. Resumes paused tasks. Can be called multiple times.

onPause(): Partially obscured by another activity or dialog. Save data and stop resource-consuming tasks. Guaranteed to be called before onStop().

onStop(): Activity no longer visible. Release resources and save data. Can be called multiple times.

onDestroy(): Final cleanup before activity destroyed. Free up memory and resources. Called once.

Related questions

0 votes
asked Aug 31, 2023 in Android Library by Robindeniel
0 votes
asked Oct 2, 2023 in Python Imaging Library by sharadyadav1986
...