Handler mReceiverhandler=new Handler();
Runnable mRecerverrunnable=new Runnable(){
@Override
Runnable mRecerverrunnable=new Runnable(){
@Override
public void run() {
// TODO Auto-generated method stub
mReceiverhandler.postDelayed(mRecerverrunnable, 1000);
}
};
在启动timer的地方写入: mReceiverhandler.postDelayed(mRecerverrunnable, 1000);
在停止的地方写入: mReceiverhandler.removeCallbacks(mRecerverrunnable);