2015-07-28 17:29:19 这一篇主要看看布局过程 一.布局过程肯定要不可避免的涉及到layout()和onLayout()方法,这两个方法都是定义在View.java中,源码如下: /** * Assign a size and position to a view and all of its * descendants * * <p>This is the second phase of the layout mechanism. * (The first is measur
========4 关于android的一个常见错误:Unable to add window --token is not valid android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@41791b20 is not valid; is your activity running?at android.view.ViewRootImpl
Android异常:android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. 出现这个异常的原因是你在子线程中修改了主线程中的组件的状态或数据..翻译过来就是:只有创建这个控件的线程才能去更新该控件的内容. android规定:只有在原始线程中(主线程,UI线程)才能修改显示组件. 解决方