/**
* Created by Kevin on.
*<br/>
* 判断是否快速点击,快速点击两次不让第二次不生效
*/
public class DoubleClickUtils {
private static long lastClickTime;
public static boolean isDoubleClick() {
long currentTime = System.currentTimeMillis();//当前时间
long timeInterval = currentTime - lastClickTime;
if (0 < timeInterval&& timeInterval< 1500) {
return true;//如果间隔在0-1.秒内就是快速重复点击
}
lastClickTime = currentTime;
return false;
}
}
转载于:https://my.oschina.net/zhangjie5201314/blog/775866