- Gityuan – startActivity啟動過程分析
- 點選桌面App圖示,Launcher程序采用Binder IPC向system_server程序發起startActivity請求;
-
程序接收到請求後,向system_server
程序發送建立程序的請求;zygote
-
程序Zygote
出新的子程序,即fork
;App程序
- App程序,通過
IPC向Binder
程序發起sytem_server
請求;attachApplication
-
程序在收到請求後,進行一系列準備工作後,再通過system_server
IPC向App程序發送binder
請求;scheduleLaunchActivity
- App程序的
線程(ApplicationThread)在收到請求後,通過binder
r向主線程發送handle
消息;LAUNCH_ACTIVITY
- 主線程在收到
後,通過發射機制建立目标Message
,并回調Activity
等方法。Activity.onCreate()