A Management life cycle

Source: Internet
Author: User

When the user navigates, exits, and returns your app, the instances in the app Activity will transform different states during their life cycle. For example, when your activity first starts, it will appear in the system foreground and receive the user focus. In this process, the Android system invokes a series of life-cycle methods on the activity, through which you can set up the user interface and other components. If a user performs an action that starts another activity or switches to another app, when it enters the background (where activity is no longer visible, but the instance and its state are intact), the system invokes a different set of life-cycle methods on your activity.

Within the life cycle callback method, you can declare the activity behavior of the user when they leave and re-enter the activity. For example, if you are building a streaming video player, you may want to pause the video or terminate the network connection when the user switches to another app. When the user returns, you can reconnect to the network and allow the user to continue playing the video from the same location.

This lesson describes Activity the important lifecycle callback methods that each instance receives and how you can use them to make your activity work as expected by the user and not consume system resources when your activity does not need them.

Course
Start activity
Learn the basics about the activity lifecycle, how users start your app, and how to perform basic activity creation operations.
Suspend and resume activity
Learn what happens when activity pauses (partially hidden) and continues, and what you should do during these state changes.
Stop and start the activity again
Learn what happens when a user completely leaves your activity and returns to that activity.
Re-create activity
Learn what happens when your activity is destroyed and how you can reconstruct the activity as needed.

A Management life cycle

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.