-
-
Save GerganaT/f77df1861139064712d9d17df8203e71 to your computer and use it in GitHub Desktop.
Android - check if running on main thread
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
public boolean runningOnMainThread() { | |
return Looper.getMainLooper().getThread() == Thread.currentThread(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment