1、创建一个工具类
public class FunctionUtils {
private static long lastClickTime;
public static boolean isFastDoubleClick() {
long time = System.currentTimeMillis();
long timeD = time - lastClickTime;
if (0 < timeD && timeD < 1000) {
return true;
}
lastClickTime = time;
return false;
}
}
2、增加判断防止快速点击
if (!FunctionUtils.isFastDoubleClick()) {
Intent intent = new Intent(A, B);
startActivity(intent);
}