标签:
1、Handler延迟2s执行一个runnable
Handler handler=new Handler(); Runnable runnable=new Runnable() { @Override public void run() { // TODO Auto-generated method stub if(xsLayout.getVisibility()==View.VISIBLE){ xsLayout.setVisibility(View.GONE); } } }; handler.postDelayed(runnable, 2000);
2、在runnable被执行之前取消这个定时任务
handler.removeCallbacks(runnable);
Done!
标签:
原文地址:http://www.cnblogs.com/xingyyy/p/4231675.html