handler和Timer的用法

final Handler handler = new Handler()
{
public void handleMessage(Message msg)
{
if (msg.what == 0x123)
{
invalidate();
}
}
};
final Timer timer = new Timer();
timer.schedule(new TimerTask()
{
@Override
public void run()
{

// 发送消息,通知系统重绘组件
handler.sendEmptyMessage(0x123);
}
}, 0, 100);

上一篇:React入门--------顶层API


下一篇:A Pattern Language for Parallel Programming