Activity start

The startup of the Android program first starts the Launcher program (that is, it can be understood as the system desktop), and then the Launcher notifies and starts an APP, and each APP starts from the Activity. This series of processes are carried out in the Launcher, Instrumentation, ActivityManagerProxy, ActivityManagerService, ActivityStack, ApplicationThreadProxy, ApplicationThread, ActivityThread, Handler and other classes, which are briefly summarized into five steps, as follows:

One: Launcher notifies ActivityManagerService through Binder inter-process communication mechanism, it wants to start an Activity.

Two: ActivityManagerService notifies Launcher to enter Paused state through Binder

Three: Laucher notifies ActivityManagerService through Binder to create a new process to start the ActivityThread instance (just to let the Activity run in this ActivityThread)

Four: ActivityThread passes the Binder of ApplicationThread type to ActivityThreadService through Binder to facilitate subsequent communication

Five: ActivityManagerService starts Activity through ActivityThread


Reference blog: https://blog.csdn.net/luoshengyang/article/details/6689748

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325427216&siteId=291194637