Only the original thread that created a view hierarchy can touch its views.

简介: /********************************************************************************** * Only the original thread that created a view hierarchy can touch its views. * 说明: * 自定义view的时候出现这个错误,是用错了方法。
/**********************************************************************************
 *  Only the original thread that created a view hierarchy can touch its views.
 * 说明:
 *     自定义view的时候出现这个错误,是用错了方法。
 * 
 *                                     2016-6-15 深圳 南山平山村 曽剑锋
 *********************************************************************************/

一、参考文档:
    Android “Only the original thread that created a view hierarchy can touch its views.”
        http://stackoverflow.com/questions/5161951/android-only-the-original-thread-that-created-a-view-hierarchy-can-touch-its-vi

二、解决办法
    将线程中调用的 invalidate(); 换成 postInvalidate();

 

目录
相关文章
|
6月前
|
Android开发
Can t process attribute android:fillColor=@color/camera_progress_delete: references to other resou
Can t process attribute android:fillColor=@color/camera_progress_delete: references to other resou
44 1
|
6月前
【echarts报错】: ‘normal‘ hierarchy in itemStyle has been removed since 4.0.
【echarts报错】: ‘normal‘ hierarchy in itemStyle has been removed since 4.0.
362 0
|
6月前
|
XML 数据格式
android.view.InflateException: Binary XML file line #0: Attempt to invoke virtual
android.view.InflateException: Binary XML file line #0: Attempt to invoke virtual
32 0
|
Android开发
【错误记录】Android 文件查看错误 ( Error opening contents of device file ““: Cannot create directory )
【错误记录】Android 文件查看错误 ( Error opening contents of device file ““: Cannot create directory )
609 0
【错误记录】Android 文件查看错误 ( Error opening contents of device file ““: Cannot create directory )
App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW in
App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW in
122 0
|
Java
Could not find class 'android.support.v4.view.ViewPager', referenced from method***
Could not find class 'android.support.v4.view.ViewPager', referenced from method***
156 0
Could not find class 'android.support.v4.view.ViewPager', referenced from method***
- Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as t
vue.js报错如下: - Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as , as they will not be parsed.
5647 1