Android9.0 Activity显示过程
2019-11-04 13:59:40 0 举报
Android9.0 Activity显示过程
作者其他创作
大纲/内容
Activity#performCreate()
handler.post
PhoneWindow#setContentView()
ViewRootImpl#requestLayout()
将ID为ID_ANDROID_CONTENT的FrameLayout指向mContentParent
1.初始化PhoneWindow2.初始化WindowManager3.给mWindowManager赋值。
Instrumentation#callActivityOnResume()
WindowManagerImpl#addView()
mDecor=generateDecor()
Instrumentation#callActivityOnCreate()
TraversalRunnable#performLayout()
ViewRootImpl#scheduleTraversals()
Activity#attach()
root=new ViewRootImpl()
mContentParent = generateLayout(mDecor);
ViewRootImpl#setView(decor)
Activity#onContentChanged()
ActivityThread#handleResumeActivity()
提供PhoneWindow实例
Activity#setContentView()
TraversalRunnable#performMeasure()
ActivityThread#performLaunchActivity()
TraversalRunnable#performDraw()
只是理论的调用顺序不是实际的调用过程
TraversalRunnable#doTraversal()
ActivityThread#handleStartActivity()
TraversalRunnable#performTraversals()
PhoneWindow#installDecor()
mDecor.onResourcesLoaded();
WindowManagerGlobal#root.setView(decor)
ActivityThread#startActivityNow()
收藏
0 条评论
下一页