Last active
June 26, 2020 04:44
-
-
Save kishandonga/773dd438943381fa094cef69f390945c to your computer and use it in GitHub Desktop.
Android Preventing Double Click On A Button
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
import android.os.Handler; | |
public class FrequentClickBlocker { | |
private boolean mIsBlockClick = true; | |
public void release() { | |
new Handler().postDelayed(() -> mIsBlockClick = true, 1000); | |
} | |
public void block() { | |
mIsBlockClick = false; | |
} | |
public boolean status() { | |
return mIsBlockClick; | |
} | |
} |
Author
kishandonga
commented
Jun 26, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment