2秒内防止快速点击的实现
2019-02-26 本文已影响0人
GaoXiaoGao
public class FastClickUtils {
private static final int MIN_CLICK_DELAY_TIME =2000;
private static long lastClickTime;
public static boolean isFastClick() {
boolean flag;
long curClickTime = System.currentTimeMillis();
if ((curClickTime -lastClickTime) >=MIN_CLICK_DELAY_TIME) {
flag =false;
}else{
flag =true;
}
lastClickTime = curClickTime;
return flag;
}
}