标签:启动过程 服务 request start imp 实现 成功 read make
Activity 启动过程:
startActivity()-> Instrumentation.execStartActivity()-> Binder->ActivityManagerService-> Zygote fork app -> Binder -> ApplicationThread.scheduleLaunchActivity() - > Handler -> ActivityThread.handleLaunchActivity() -> performLauncherActivity -> Instrumentation create Activity -> 设置 application ,创建 ContextImpl,调用 attatch 方法,调用 Instrumentation 的 callActivityOnCreate-> Activity.onCreate()
-> setContentView() -> PhoneWindow.setContentView() -> DecorView . setContentView(); -> handleLaunchActivity()-> handleResumeActivity()-> Instrumentation.callActivityonResume()->Activity.onResume(); -> handleLaunchActivity() -> Activity.makeVisibile() ; -> Activity.makeVisibile()-> WindowManager.addView() - > WindowManagerImpl.addView()->WindowManagerGlobal.addView()-> ViewRootImpl.setView() -> requestLayout -> scheduleTranversals()->Runable->doTranversals()->performTranversales()->measure()->layout()->draw();
涉及到进程间通讯 Binder
涉及到线程间通讯 Handler
涉及到 View 的绘制流程
关键类还有 Window, PhoneWindow ,WindowManager ,WindowManagerImpl, WindowManagerGlobal, ViewRootImpl, DecorView
关键类:
标签:启动过程 服务 request start imp 实现 成功 read make
原文地址:https://www.cnblogs.com/liyiran/p/9223785.html