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":