Api-guides translation of my study notes------appcomponent_activites

Source: Internet
Author: User

10.26 the beginning of the day: you insist, look at the finishing

An application is usually composed of multiple activity, which are loosely coupled relationships. In particular, there is an activity as the main activity of the app, which is presented to the user when the app is first launched.
Each ay can start another to show a different action, whenever a test ay starts, the previous opportunity stops, but the system keeps it in the back stack. When an explicit new ay starts, it is pushed to the top of the stack to get the user focus.

When an ay is stopped due to another AY drive, the change in this state is notified by the callback function of the AY's life cycle. Depending on the state, Ay may receive a number of callback functions, each of which will give you the opportunity to handle a particular job in response to a change in state. For example, when stop, your AY should release large objects such as network connections and database connections. When Ayresume, you can re-request the necessary resources and restore the original interrupted action. These state transitions are part of the AY life cycle.

Create Ay:
To create an ay, you must create a subclass of activity, or a subclass of an existing subclass of activity. In your subclass, you must implement the callback functions that the system needs to change between states during the life cycle, such as create, stop, restore, or destroy. The two most important callback functions are:
OnCreate (): You have to implement this method. When you create AY, the system calls it. When implemented you need to initialize the important components of your ay. Most importantly, here you have to call Setcontentview () to define the layout of the Ay UI.

Api-guides translation of my study notes------appcomponent_activites

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.