1.
1)定义
private static long lastClickTime;
/**
* 是否快速点击
* @return
*/
public static boolean isFastDoubleClick() {
long curTime = System.currentTimeMillis();
long timeD = curTime - lastClickTime;
if ( 0 < timeD && timeD < 1000) {
return true;
}
lastClickTime = curTime;
return false;
}
2)调用
if(UIHelper.isFastDoubleClick()){
return;
}
3)个别情况下仍然会出现打开多个窗口问题。
2.
ll_dp_product_options.setClickable(false);
.......
ll_dp_product_options.setClickable(true);
个别情况下仍然会出现打开多个窗口问题。
3.
private boolean canClickBtnAddInsurant = true;
if (canClickBtnAddInsurant) {
canClickBtnAddInsurant = false;
.......
new Thread() {
public void run() {
try {
sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
canClickBtnAddInsurant = true;
};
}.start();
}
个别情况下仍然会出现打开多个窗口问题。