赞
踩
Activity视图层级图
Activity的初始化
Activity的初始化是从从Activity的setContentView(),源码为
public void setContentView(View view) {
getWindow().setContentView(view);
initWindowDecorActionBar();
}
public void setContentView(@LayoutRes int layoutResID) {
getWindow().setContentView(layoutResID);
initWindowDecorActionBar();
}
public void setContentView(View view, ViewGroup.LayoutParams params) {
getWindow().setContentView(view, params);
initWindowDecorActionBar();
}
三种重载方法,都有调用initWindowDecorActionBar()为显示Decor和ActionBar
private void initWindowDecorActionBar() {
//window是抽象类,所以找其实现类phoneWindow
Window window = getWindow();
//初始化decorview
window.getD
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。