1)动态加载Layout的代码是 getWindow().setContentView(LayoutInflater.from(this).inflate(R.layout.main, null)); 它等同于 setContentView(R.layout.main); 其实 getWindow().setContentView(LayoutInflater.from(this).inflate(R.layout.main, null))  是 setContentView(R.layout.…
1)动态载入Layout的代码是 getWindow().setContentView(LayoutInflater.from(this).inflate(R.layout.main, null)); 它等同于 setContentView(R.layout.main); 事实上 getWindow().setContentView(LayoutInflater.from(this).inflate(R.layout.main, null))  是 setContentView(R.layout…
我在研究任玉刚老师的<android开发艺术探索>的关于windowmanager那一章时,我发现自己对于acitivity.window和view之间的概念还是比较模糊. 然后查了一下android官方文档,actvity定义如下: An Activity is an application component that provides a screen with which users can interact in order to do something, such as dial…
activity 构造一个实现了window的phonewindow,获得viewroot,然后往里面加入view 当发生事件的时候,如KEYDOWN,windowmanagerservice就接受到这个消息,并回调activity里面的对应方法 也就是说activity是控制单元,window是承载模型,view是具体是实现…
转自 http://www.cnblogs.com/loulijun/archive/2012/02/09/2344681.html Activity其实更像一个控制单元,控制window上显示的View内容,比如在Activity里有一个addContentView()方法,实际上调用了window的addContentView()方法 /** * Add an additional content view to the activity. Added after any existing…
1.先看一个现象 1 2 3 4 5 6 7 8 9 10 11 public class MainActivity extends Activity {       @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         //setContentView(R.layout.activity_main);      …
在activity的attacth方法中,通过policymanager 的makenewwindow来创建window 而window的具体实现是phonewindow 接下来通过setcontentview来加载view 具体过程分析: (1)如果没有DecorView,创建它 创建时通过inflater来加载view (2)将view添加到DecorView的mcontentparent中 (3)回调Activity 的oncontentchanged方法通知activity视图已经发生了…
Activity工作过程: Activity.startActivity--> Activity.startActivityForResult--> Instrumentation.execStartActivity--> ActivityManagerNative.getDefault().startActivity--> ActivityManagerService.startActivity--> ActivityStackSupervisor.startActivit…
http://blog.csdn.net/chiuan/article/details/7062215 http://blog.163.com/fenglang_2006/blog/static/133662318201022104256580/ Activity Window View的关系 问题: Activity是Android得显示视图么? 题目中它们之间的关系? LayoutInlater()是做什么的? layoutInflater.inflater()是做什么的? 1.PhoneW…
http://www.cnblogs.com/linjzong/p/4191891.html https://www.cnblogs.com/kest/p/5141817.html https://blog.csdn.net/qq_21399461/article/details/79836806 Android事件分发机制完全解析,带你从源码的角度彻底理解(上) Android事件分发机制完全解析,带你从源码的角度彻底理解(下) Android事件传递之onInterceptTouchEven…