Skip to content

Instantly share code, notes, and snippets.

@otw
Created February 21, 2013 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save otw/5004603 to your computer and use it in GitHub Desktop.
Save otw/5004603 to your computer and use it in GitHub Desktop.
public static void checkUIThread()
{
if (Looper.myLooper() != null && Looper.myLooper() == Looper.getMainLooper())
{
throw new IllegalStateException("Running on UI Thread");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment