Introduction to Android Development (i) Detailed activities 1.1 activity life cycle

Source: Internet
Author: User

Objective:

Android has been learning for over a year and is currently working on Android development. Dare not say proficient, but also small have experience. I believe many Android beginners and I just started to contact with Android, often only to understand the surface of some knowledge points, if others ask something, but also really can not say a Sanlai, often in the "understanding" stage. So, I am going to learn the Android process and experience summed up, published, I hope to learn about Android students help, but also to their own learning to summarize it. Life is endless and learning is more than. Must learn to "enjoy" the process of learning, otherwise, learning will be very tired.

In my learning process, there is a little experience to share with you, that is "Deep Learning": in-depth study. It's better to take more time to study in depth than to go through it. Sometimes, we can not learn, but learn too fast, forget quickly. Rather than a knowledge point of a knowledge point of the slowly learn, learn, fully mastered. Today, let's talk about the life cycle of activity, many interviewers like to ask this question ... In fact, it's simple to remember the timing of some callback function being triggered.

Writing intent: Hope to let those who learn the Android program development of the students to take some detours, that's all. I'm not Daniel, I'm just trying to make some humble effort.

Activity, a class that defines a callback function to control its lifecycle.

OnCreate ()--called when the activity was first created.

OnStart ()-Called when the activity is visible to the user.

Onresume ()--called when the activity starts interacting with the user.

OnPause ()--The running activity is called when it is suspended immediately, and the activity before that is retrieved.

OnStop ()--called when the activity is not visible to the user.

By default, the created activity contains a OnCreate () method that enables you to create UI components that are displayed to the user.

Diagram of life cycle from "created" to "destroyed":

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.