http://blog.youkuaiyun.com/flying_tao/article/details/6756127
http://blog.youkuaiyun.com/gebitan505/article/details/18149981
1.利用定时器
TimerTask task = new TimerTask(){
public void run(){
//execute the task
}
};
Timer timer = new Timer();
timer.schedule(task, delay);
2.利用Handler
new Handler().postDelayed(new Runnable(){
public void run() {
//execute the task
}
}, delay);
其中,delay表示延迟的时间,单位:毫秒。