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