美文网首页
2秒内防快速点击

2秒内防快速点击

作者: GaoXiaoGao | 来源:发表于2019-06-28 12:04 被阅读0次
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;
    }
}

相关文章

网友评论

      本文标题:2秒内防快速点击

      本文链接:https://www.haomeiwen.com/subject/fmsscctx.html