Skip to content

Instantly share code, notes, and snippets.

@aagarwal1012
Created August 25, 2019 18:31
Show Gist options
  • Save aagarwal1012/8865ba214a60a037235ed5573b33c3a3 to your computer and use it in GitHub Desktop.
Save aagarwal1012/8865ba214a60a037235ed5573b33c3a3 to your computer and use it in GitHub Desktop.
@UiThread
void onUiThread() {}
void unannotatedCallsUiThread() {
onUiThread();
}
@WorkerThread
void testMethodAnnotations(TextView textView) {
textView.setText(""); // correct: displays warning.
onUiThread(); // correct: displays warning.
// UNEXPECTED: the following method does not display a warning.
// I expect it to because it calls a @UiThread annotated method.
unannotatedCallsUiThread();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment