activity加载布局的流程

通过一张图来描述activity加载布局的过程


activity加载布局的流程_第1张图片

1.activity中的setConentView 通过getWindow().setContentView(layoutResID);

2.getWindow(),通过attach的mWindow =new PhoneWindow(this, window);获取Window对象

3.在PhoneWindow中,setContentView 调用了installDecor

4.installDecor中,调用了generateDecor获得DecorView对象

5.decorView是activity的根view。

你可能感兴趣的:(activity加载布局的流程)