private long lastClick; public void publish_click(View v) { //大于一秒方可通过 if (System.currentTimeMillis() - lastClick <= 1000) { showToast("点那么快干什么!!!"); return; } lastClick = System.currentTimeMillis(); showToast("超过一秒点击就可以再次看到我了哦!"); }
原文:http://blog.csdn.net/chaoyong918/article/details/43564957