1、定时器
TimerTask task = new TimerTask(){ public void run(){ //逻辑 } }; Timer timer = new Timer(); timer.schedule(task, 500);//延时0.5秒2、消息
new Handler().postDelayed(new Runnable(){ public void run() { //逻辑 } }, 500);//延时0.5秒 3、线程,因为sleep的原因不推荐try{ Thread thread = Thread.currentThread(); thread.sleep(500);//延时0.5秒}catch (InterruptedException e) { e.PRintStackTrace();}
新闻热点
疑难解答