public class ButtonUtils { private static long lastClickTime; public synchronized static boolean isFastClick() { long time = System.currentTimeMillis(); if (time - lastClickTime < 500) { return true; } lastClickTime = time; return false; } }
使用的时候:
时间: 2024-11-07 22:28:46