Skip to content

Instantly share code, notes, and snippets.

@Reacoder
Created July 23, 2014 03:56
Show Gist options
  • Save Reacoder/48683e90095a395d9a01 to your computer and use it in GitHub Desktop.
Save Reacoder/48683e90095a395d9a01 to your computer and use it in GitHub Desktop.
判断是不是在主线程中。
static boolean isMain() {
return Looper.getMainLooper().getThread() == Thread.currentThread();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment