写事件分发源码分析的时候很纠结,网上的许多博文都是先分析的View,后分析ViewGroup.因为我一开始理解的时候是按我的流程图往下走的,感觉方向很对,单是具体分析的时候总是磕磕绊绊的,老要跳到View中去分析,很多方法理解不了,但毕竟流程清楚了许多,算是有得有失吧,不多说,开始分析. 继续根据流程,先分析View的dispatchTouchEvent()方法,看源码. public boolean dispatchTouchEvent(MotionEvent event) { // If t…
什么是Handler? Android 的官方解释: 文档分节1:A Handler allows you to send and process Message and Runnable objects associated with a thread's MessageQueue. Each Handler instance is associated with a single thread and that thread's message queue. When you create…
本节简单分析View视图对象的render方法 View接口 最重要的就是render()方法,具体源码如下 /** * Render the view given the specified model. * <p>The first step will be preparing the request: In the JSP case, * this would mean setting model objects as request attributes. * The second s…