Android 应用启动流程

一、Android 应用启动调用的方法如下,稍后更新时序图:

startActivity(Activity) ---> startActivityForResult(Activity)--->execStartActivity(Instrumentation) --->

startActivity(AMS) ---> startActivityMayWait(ActivityStackSuperVisor) ---> startActivityLocked(ActivityStackSuperVisor) --->

startActivityUncheckedLocked(ActivityStackSuperVisor) launchMode ---> startActivityLocked(ActivityStack) --->  resumeTopActivitiesLocked(ActivityStackSuperVisor)  --->resumeTopActivityLocked(ActivityStack)  ---> resumeTopActivityInnerLocked(ActivityStack) finish stack options ---> startPausingLocked(ActivityStack)

---> schedulePauseActivity(ActivityThread) ---> handlePauseActivity(ActivityThread) ---> activityPaused(AMS) --->completePauseLocked(AMS)

---> resumeTopActivitiesLocked(ActivityStackSuperVisor) ---> startSpecificActivityLocked(ActivityStackSuperVisor) ---> startProcessLocked(AMS) ---> newProcessRecordLocked()

---> Process.start() ---> main(ActivityThread) ---> attach(ActivityThread) ---> attachApplication(AMS)  ---> attachApplicationLocked(AMS)  --->attachApplicationLocked(ActivityStackSuperVisor) ---> realStartActivityLocked(ActivityStackSuperVisor) ---> scheduleLaunchActivity(ActivityThread) ---> handleLaunchActivity(ActivityThread)

---> performLaunchActivity ---> handleResumeActivity  ---> performResumeActivity

你可能感兴趣的:(Android 应用启动流程)