6 - Activity Life Cycle
6 - Activity Life Cycle
6 - Activity Life Cycle
• An activity being in this state means that the user can still see
the Activity in the background such as behind a transparent
window or a dialog box i.e it is partially visible.
• The user cannot interact with the Activity until he/she is done with
the current view.
• Android Runtime usually does not kill an Activity in this state but
may do so in an extreme case of resource crunch.
2. Paused State …
3. Resumed State …
◾ The Android onPause() method is invoked when the activity doesn’t receive
any user input and goes on hold. In the pause state, the activity is partially
visible to the user. This is done when the user presses the back or home
buttons. Once an activity is in the pause state, it can be followed by either
onResume() or onStopped() callback method.
onRestart()
◾ The Android onRestart() method is invoked when activity is about to start
from the stop state. This method is to restart an activity that had been
active some time back. When an activity restarts, it starts working from
where it was paused.
onResume()
◾ The Android onResume() method is invoked when the user starts
interacting with the user. This callback method is followed by
onPause(). Most of the functionalities of an application are
implemented using onResume().
onStop()
◾ https://medium.com/hootsuite-engineering/handling-orientation-changes-on-android-41a6b62cb43f
References
◾ https://developer.android.com/guide/topics/manifest/manifest-intro
◾ https://www.studytonight.com/android/activity-in-android
◾ https://data-flair.training/blogs/android-activity/