private static final int MIN_CLICK_DELAY_TIME =1000;
private static long lastClickTime;
private static int lastBtnId;
/**
* 判断是否连续点击
*/
public static boolean isFastClick(int viewId) {
if (lastBtnId == viewId) {
boolean flag =true;
long curClickTime = System.currentTimeMillis();
if ((curClickTime -lastClickTime) >=MIN_CLICK_DELAY_TIME) {
flag =false;
}
lastClickTime = curClickTime;
return flag;
}else {
lastBtnId = viewId;
lastClickTime = System.currentTimeMillis();
return false;
}
}