Activity的启动流程
2020-07-13 15:20:35 0 举报
Activity的启动
作者其他创作
大纲/内容
handleResumeActivity
execute
startActivity
realStartActivityLocked
system_server
IPC
scheduleTransaction
ResumeActivityItem
resumeTopActivityUncheckedLocked
ActivityStackSupervisor
resumeTopActivityInnerLocked
Activity
performLaunchActivity
1. 创建activity实例2 创建Application对象,调用了Application的onCreate方法。3. activity.attach方法。4. 调用Activity的onCreate方法
LaunchActivityItem
handMessage(切到主线程)
TransactionExecutor
H
ActivityTaskManagerService
是否有进程?
Instrumentation
1. 调用生命周期onStart、onResume2. 设置视图可见(所以视图的真正可见是在onResume方法之后)
startSpecificActivityLocked
startActivityUnchecked
handleLaunchActivity
scheduleTransaction(执行在Bind线程池)
APP
是
startActivityForResult
ApplicationThread
execStartActivity
startActivityAsUser
ActivityStack
executeCallbacks
1、ClientTransaction添加了LaunchActivityItem实例2、使用ATMS的ClientLifecycleManager的scheduleTransaction方法,发送ClientTransaction(还使用clientTransaction.setLifecycleStateRequest方法添加了ResumeActivityItem)3、内部调用了 IApplicationThread的scheduleTransaction方法,即IPC操作
executeLifecycleState
ActivityThread
ActivityStarter
0 条评论
下一页