view如何被添加到window上并显示出来
view如何被添加到window上并显示出来:
1.主线程activityThread,handleLaunchActivity中加载完activity后,执行handleResumeActivity,其中wm.addView(decor, l);
2.执行WindowManagerImpl中的addview,
3.再调用WindowManagerGlobal中的addview,
4.通过viewRootImpl.setView,根据setView中的requestLayout,执行mTraversalRunnable,doTraversal(),performTraversals,进入view的绘制。
几个class
- ActivityThread
- WindowManagerImpl
- WindowManagerGlobal
- ViewRootImpl