Post invalidate方法在Thread类中做了什么

时间:2015-07-28 06:29:27

标签: multithreading android-custom-view java-threads

这是我的代码:

package com.example.analogclock;

    import android.view.View;


public class MyThread implements Runnable {

    private View view;

    public MyThread(View v){
        view = v;
    }

    public void run() {
        while(true){
            try {
                Thread.sleep(1000);
                view.postInvalidate();
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    }

}

0 个答案:

没有答案