Handler用法

一、handler + runnable

Handler mHandler = new Handler();
//将runnable加入到handler的线程队列中
mHandler.post(runnable);
Runnable runnable = new Runnable() {
            @Override
            public void run() {
                textView.append("haha");
                mHandler.postDelayed(this,1000);
            }
        };

你可能感兴趣的:(Handler用法)