When a user enters, exits, and enters your app again, your app Activity will switch between the various states of its life cycle. For example, when your activity starts for the first time, it appears in front of the system to accept the user's focus. In this process, the Android system invokes a series of life cycle methods to set up the UI and other components. If a user performs an action, initiates another activity or switches to a different application, your activity moves to the background (when activity is not visible, but its strength and status remain the same), and the system invokes additional life cycle methods.
Through these life cycle methods, you can declare how your activity behaves when the user leaves and enters your activity again. For example, if you are building a streaming file for a video player, you may want to pause the screen while terminating the network request when the user switches to another app. When the user comes back, you can reconnect the network and allow the user to watch the video again from the same place.
This course explains the Activity important life cycle approaches that instances receive and how you can do your activity to meet users ' expectations and not continue to consume them when the activity does not require system resources.
Course
-
starting an Activity
-
Learn the basics of activity declaration cycles, how users start your app, and how to perform basic activity creation.
-
pausing and Resuming an Activity
-
learning in your Activ What happens when itypaused (partially obscured) and resumed, and what you should do when these states change.
-
Stopping and restarting an Activity
-
Learn when the user is fully Out of your activity, and what happens when you re-come back to your activity.
-
recreating an Activity
-
Learn what happens when your app has been destroyed to And how you can recreate the state of your activity when necessary.