解决方案 »

  1.   

    invalidate(); 可以在非UI线程中调用?
      

  2.   

    UI线程与非UI线程职责没分清楚的问题吧
      

  3.   

    postInvalidate();也试过了不好使啊!
      

  4.   

    在handler里面加delay和while循环的做法不对。Handler默认就是在主线程,你这样sleep,invalidate导致的重画就执行不了。你可以修改下这边的做法,或者新建一个thread,把handler绑到这个新的thread上去。
      

  5.   

      系统绘制时候  第一步会判断是否忽略绘制。    /**
         * Do not invalidate views which are not visible and which are not running an animation. They
         * will not get drawn and they should not set dirty flags as if they will be drawn
         */
        private boolean skipInvalidate() {
            return (mViewFlags & VISIBILITY_MASK) != VISIBLE && mCurrentAnimation == null &&
                    (!(mParent instanceof ViewGroup) ||
                            !((ViewGroup) mParent).isViewTransitioning(this));
        }
    可能原因 有两个   1 你的threadSleep 间隔太短了, 系统忽略掉之前的绘制请求,采用最后一个。
                                     2 你调用 handler.post(mUpdateResults); 时候  控件还未完全本身的绘制。即 你是不是在Activity的create中调用?
      

  6.   

    还有你的pre 成员变量 如果没被改变过  你的while 语句 只执行一次。
      

  7.   

    谢谢大家 !最后我还是用surfaceview解决了!不过长知识了!!!!!!