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的时候出现这个错误,是用错了方法。
 * 
 *                                     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();

 

posted on 2016-06-15 10:20  zengjf  阅读(530)  评论(0编辑  收藏  举报

导航