简体   繁体   中英

Which component passes the events and intents to our application if not zygote?

I am confused of how the actual lifecycle flow is implemented.
When a user clicks on an application icon, that click goes to a special application called Zygote which then forks a new process for the clicked application to run. I can understand the benefits of doing that.

What is not clear to me is, how does the new application actually starts entering the android lifecycle? Ie how the main activity is loaded, which of the code runs and how are the lifecycle events/intents are passed/processed as checking the code for Zygote I don't see anything more happening than doing the fork.
The way I understand it there must be something more than just zygote forking a process but I can't figure out what. Does anyone have any knowledge/guidance on the topic?

Most of this code is/was in the ActivityManagerService class. It uses some native code, but this class is/was responsible for starting processes, launching activities into processes, dispatching broadcast Intent s, etc.

This may have changed at some point, I can't guarantee that it still works like this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM