0

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? I.e. 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?

Jim
  • 3,845
  • 3
  • 22
  • 47
  • Legacy videos but provides historical context for when Android started: [Google I/O 2008 - Inside the Android Application Framework](https://youtu.be/TkPiXRNee7A) and [Google I/O 2008 - Anatomy and Physiology of an Android](https://youtu.be/G-36noTCaiA). New stuff like ART can be found in more recent Google IO videos and https://source.android.com/devices/tech/dalvik – Morrison Chang Mar 26 '21 at 10:57

1 Answers1

0

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 Intents, etc.

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

David Wasser
  • 93,459
  • 16
  • 209
  • 274