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();

 

目录
相关文章
|
8月前
|
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
49 1
|
8月前
【echarts报错】: ‘normal‘ hierarchy in itemStyle has been removed since 4.0.
【echarts报错】: ‘normal‘ hierarchy in itemStyle has been removed since 4.0.
420 0
Unknown custom element: <add-employee> - did you register the component correctly? For red cursive c
原因: 1.组件名没写对(导入和注册不对应) 2.components少写了个s 3.组件命名最好是驼峰命名 4.导入时语法错误 5.代码中有两个components,后一个的值把前一个覆盖了 6.组件直接循环套用了
104 0
|
8月前
|
XML Android开发 数据格式
Error obtaining Ul hierarchy Reason: Error while obtaining Ul hierarchy XML file
Error obtaining Ul hierarchy Reason: Error while obtaining Ul hierarchy XML file
248 1
|
8月前
|
XML Android开发 数据格式
Error obtaining Ul hierarchy Reason_ Error while obtaining Ul hierarchy XML file
Error obtaining Ul hierarchy Reason_ Error while obtaining Ul hierarchy XML file
92 0
|
前端开发 JavaScript
[Bugfix]it looks like you called `mount()` without a global document being loade
jest测试react组件时尝试获取mount组件报错,并无法进行测试,解决过程记录。
101 1
- 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.
5662 1

热门文章

最新文章