Skip to content

Instantly share code, notes, and snippets.

@Dimezis
Last active March 28, 2019 21:24
Show Gist options
  • Save Dimezis/c473dc4c9df75333cd224e3b77fb3404 to your computer and use it in GitHub Desktop.
Save Dimezis/c473dc4c9df75333cd224e3b77fb3404 to your computer and use it in GitHub Desktop.
@Override
public ViewParent invalidateChildInParent(int[] location, Rect dirty) {
checkThread();
// ... Here goes the actual invalidation logic
}
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