Android Learning Route (11) Managing the life cycle of activity

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.