Skip to content

Instantly share code, notes, and snippets.

@Hasiy
Created November 7, 2019 06:08
Show Gist options
  • Save Hasiy/cba2cdc014ea6ab3f36aba9d9663f0ed to your computer and use it in GitHub Desktop.
Save Hasiy/cba2cdc014ea6ab3f36aba9d9663f0ed to your computer and use it in GitHub Desktop.
ViewRootImpl#checkThread 子线程不能更新UI,会抛异常
void checkThread() {
if (mThread != Thread.currentThread()) {
throw new CalledFromWrongThreadException("Only the original thread that created a view hierarchy can touch its views.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment