Android Activity Lifecycle
An app activity lifecycle methods are:
Whenever You Start an App
onCreate(): When you click on the app icon, this method onCreate() is called.
onStart(): after on create when the app is starting is called onStart(). This method set up UI, activity became visible to the user.
onResume(): Where you begin interacting with the app is what this method onResume() is called. It continues until the user closes the application or its life cycle finds something wrong.
Start the app now
onPause(): In the situation that the app closes in any way, the pause state will become active. As a result, even if your app is not at the top of the screen layer, the method will still be in use. Even so, you should be aware that this strategy is in use when the notification box displays.
onStop(): The user can’t see the action any longer. It might be partially or entirely obscured by another action, or it might be destroying itself. In this state, the method onStop() is called.
onRestart(): When you open the app after it has been sent to the background but before you closed it, the activity will restart if the onRestart method is created. where onRestart() is called before onStart().
onDestroy():The call to onDestroy() occurs before the activity is terminated. When the system activates this callback, one of two things happens: The activity is ending either because the user entirely dismissed it or because finish() was called on it, and An alteration in configuration, such as turning the device or switching to multi-window mode, is causing the system to momentarily terminate the activity.
SavedInstanceState(): When the app hits the onStop function, this method is called. You need to save data that comes from the user or the app itself, thus the onSaveInstanceState method is called after the onStop function.