Android Source--activity component Start-up process

Source: Internet
Author: User

RootActivity startup process

The process of starting mainactivity in Launcher is divided into 6 main steps:

One, Launcher to activitymanagerservice to send a start mainactivity Inter-process communication request;

Second, Activitymanagerservice first will mainactivity The information to save, and then to Launcher The component sends an inter-process communication request that enters the abort state;

Third, after the Launcher enters the abort state, sends to the activitymanagerservice a process communication request which has entered the abort state;

Iv. activitymanagerservice Start a new application process ;

Five, the new process started,activitymanagerservice send a start-up process communication between the request to activitythread;

Six, Activitythread will mainactivity components start up.

the child Activity starts the process within the process

One, mainactivity to activitymanagerservice send a start subactivity interprocess communication request;

Second, Activitymanagerservice save subactivity component information, and then to mainactivity Send an inter-process communication request into the abort state;

Third, the mainactivity enters the abort state, and returns the state to the activitymanagerservice;

Activitymanagerservice sends the subactivity saved component to the application, and subactivity starts up.

Whether an Activity component starts in an existing application process or starts in a new application process depends on the following two factors:

the user IDof the Activity component;

The Android:process property of the Activity component .

Task is used to integrate a series of related Activity components together to complete a business function. These activity can be used in different processes, which makes the activity component reusable.

The above content read the "Android system source code Scenario Analysis" 7th Chapter "Activity component startup Process" summary.

Android Source--activity component Start-up process

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.