2秒内防快速点击
2019-06-28 本文已影响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;
}
}