private Handler handler = new Handler( );
private Runnable runnable = new Runnable( ) {
@Override
public void run ( ) {
update( );
handler.postDelayed(this,1000); //每秒执行一次(1000单位为毫秒)
}
};
//PS:如下
handler.postDelayed(runnable,1000); // 开始Timer
handler.removeCallbacks(runnable); //停止Timer