I have a problem with my app that if the user clicks the button multiple times quickly, then multiple events are generated before even my dialog holding the button disappear
Just a quick update on GreyBeardedGeek solution. Change if clause and add Math.abs function. Set it like this:
if(previousClickTimestamp == null || (Math.abs(currentTimestamp - previousClickTimestamp.longValue()) > minimumInterval)) {
onDebouncedClick(clickedView);
}
The user can change the time on Android device and put it in past, so without this it could lead to bug.
PS: don't have enough points to comment on your solution, so I just put another answer.