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

Source: Internet
Author: User
Tags switches

When a user enters. When you exit and enter 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 takes the focus of the user in front of the system today. In this process, the Android system invokes a series of life cycle methods to set up the UI and other components. Suppose the user runs an operation, initiates an activity, or switches to another application. Your activity will move to the background (when activity is no longer visible, but its strength and state remain the same), and the system will invoke some other life cycle methods.

Through these life cycle methods. You can state 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 at the same time to terminate the network request when the user switches to another app. Once the user comes back, you can connect to the network again and consent to the user viewing 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 run major activity creation.
Pausing and Resuming an Activity
Learn what's going on in your activitypaused (partially obscured) and resumed, and what you should do when these states change.
Stopping and restarting an Activity
Learn what happens when a user completely leaves your activity and has returned to your activity.

Recreating an Activity
Learn what happens when your app has been destroyed. And how you can create the status of your activity again when necessary.

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

Related Article

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.