Android启动流程
2020-02-09 22:05:39 0 举报
Android启动流程
作者其他创作
大纲/内容
TootActivityContainer
scheduleTransaction(ClientTransaction transaction)
clientTransaction.addCallback(LaunchActivityItem.obtain(new Intent()....;mService.getLifecycleManager().scheduleTransaction(clientTransaction);
mClient 是ApplicationThread
ApplicationThread是ActivityThread的内部类
调用Application的onCreate方法
ClientTransaction
executeLifecycleState(transaction);
client 是ActivityThread
attachApplication(WindowProcessController app)
handleBindApplication(data);
thread是IApplicationThread,它的实现类是ApplicationThread
开启Activity线程(主线程)
ActivityManagerService
ActivityThread.this.scheduleTransaction(transaction);
ResumeActivityItem
mClient.scheduleTransaction(this)
创建Application
mTransactionExecutor.execute(transaction);
ClientTransactionHandler
executeCallbacks(transaction); executeLifecycleState(transaction);
回调onCreate方法
ActivityTaskManagerService
这里加入ResumeActivityItem或者PauseActivityItem
ActivityThread的父类
TransactionExecutor
创建Activity
main(String[] args)
ActivityThread
LaunchActivityItem
最终执行Activity的resume方法
transaction.schedule();
mAtmInternal.attachApplication(..)
ClientLifecycleManager
execute(ClientTransaction transaction)
executeCallbacks(ClientTransaction transaction)
attachApplication(WindowProcessController wpc)
mStackSupervisor.realStartActivityLocked
Application app = data.info.makeApplication(...);mInstrumentation.callApplicationOnCreate(app)
这里加入LaunchActivityItem
ActivityStackSupervisor
收藏
0 条评论
下一页