onRestart
onRestart is a lifecycle callback in Android's Activity class. It is invoked when an activity is restarting after being stopped, not when it is created for the first time.
The method is called after onStop() and before onStart() as the activity transitions from the stopped state
Usage of onRestart is optional. Developers override onRestart() to reinitialize resources or refresh UI elements that
Relation to other lifecycle methods: onRestart is followed by onStart and then onResume, leading back to user
Notes: onRestart provides a targeted hook for state restoration after a stop, but its necessity depends on