I have a delivery application where clicking the button fires a request, it turns out that's going on a bug that even with a preventive code to enter, sometimes happens in milliseconds is fired two or more applications at the same time in the event by clicking the shooting, I believe this is happening due to more than one user click on the button (although it would have to be very fast even since shortly after it appears a dialog).
I was trying to make this not happen by putting the following code right after the button is clicked:
//prevent two click the same time
if (SystemClock.elapsedRealtime() - mLastClickTime < 30000) {
Toast.makeText(getBaseContext(),"Aguarde 30 segundos para solicitar uma nova corrida",Toast.LENGTH_LONG).show();
return;
}
mLastClickTime = SystemClock.elapsedRealtime();