创建一个工具类
public class Tools {
private static long lastClickTime;
public static boolean isFastDoubleClick() {
long time = System.currentTimeMillis();
if ( time - lastClickTime < 500) {
return true;
}
lastClickTime = time;
return false;
}
}
使用的时候
public void onClick(View v) {
if (Tools .isFastDoubleClick()) {
return;
}
}