首页 > 代码库 > android 延时

android 延时

Handler mHandler=new Handler();
Runnable mRunnable= new Runnable(){
public void run(){
takeButton.setEnabled(true);////延时后想干的事
}
};

 

 

 

mHandler.postDelayed(mRunnable,2000);

mHandler.removeCallbacks(mRunnable);