Four components of Android-Activity (1) definition, status, and rollback (graphic explanation)

Source: Internet
Author: User

Four components of Android-Activity (1) definition, status, and rollback (graphic explanation)
What is the Activity Keyword: Application Component, four main components, user interface, and interaction. An Activity is an application component that provides a screen with which users can interact in order to do something open each Android application. Generally, interfaces interact with users to complete input, outputs and other functions. Activity is one of the four Android components. Activity provides a window that depicts the user interface. The window size can be: full screen window, floating window, embedded in other activities (ActivityGroup ). An application generally contains multiple activities. Each Activity is designed to focus on specific types of actions that can be executed by users, and other activities can also be started. Shows the Activity in the Chrome application. Both the Activity and the back stack activity are arranged into a stack (the back stack and the back stack are in line with the "First in Last out" principle "). When another activity is enabled for the current activity, the new activiy is pushed to the top of the stack and the focus is obtained. The previous activity is still in the stack, but it is stopped. The system retains the current status of the user interface. When you press the return button, the current activity pops up from the top of the stack (the activity is destroyed and destroyed), and the previous Activity is restored (restore the previously saved user interface status ). The activities in the stack will never be rearranged. It is only pushed in and out of the stack. The user starts from the current Activity to another Activity. The user presses the return key to exit the current Activity. Displays the situation where you enable Activity1, Activity2, and Activity3 in sequence, and then press the return key to leave Activity3 to return the result of the Activity2 stack rollback. Activity Status 1. Resumed (or running): The running status activity is on the front-end of the screen and has the user focus. 2. Paused: Pause another activity in the foreground with user focus. However, this activity is still visible ). Another Activity is on this Activity, which is partially transparent or does not cover the entire screen. A paused activity is completely alive (the Activity object is stored in the memory, it retains all the status and member information, and is still attached to the window manager ), however, when the storage space is extremely low, it will be killed by the system. 3. Stopped: The Stopped activity is completely masked by other activities (currently in the background ). A stopped activity is also alive (the Activity object is stored in the memory, which retains all the status and member information, but is not attached to the window manager) it is invisible to users and may be killed at any time when it is needed elsewhere. The following figure shows the running and paused statuses of the Activity. Second Activity is in the running state, but it does not cover the entire screen, and the previous Activity is in the paused state. (4. Killed: The Activity is in the dead state.) The Activity is Killed by the system to recycle the occupied resources or is not started. The official documents refer to Activity three states, which are not final. Easy to understand and added the killed status.

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.