Created
December 6, 2014 01:23
-
-
Save mustafa01ali/efab1f10b482a63c4bc5 to your computer and use it in GitHub Desktop.
Preventing fast clicks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private long mLastClickTime = 0; | |
protected boolean isNotAFastClick() { | |
boolean result = true; | |
if (SystemClock.elapsedRealtime() - mLastClickTime < FAST_CLICK_THRESHOLD) { | |
result = false; | |
} | |
mLastClickTime = SystemClock.elapsedRealtime(); | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment