Skip to content

Instantly share code, notes, and snippets.

@mlegy
Created October 30, 2020 06:26
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 mlegy/ddd912f1a3ef8f7cbb20c5d750fc6a47 to your computer and use it in GitHub Desktop.
Save mlegy/ddd912f1a3ef8f7cbb20c5d750fc6a47 to your computer and use it in GitHub Desktop.
@NonNull
public static ActivityMainBinding bind(@NonNull View rootView) {
// The body of this method is generated in a way you would not otherwise write.
// This is done to optimize the compiled bytecode for size and performance.
int id;
missingId: {
id = R.id.textView;
TextView textView = rootView.findViewById(id);
if (textView == null) {
break missingId;
}
return new ActivityMainBinding((ConstraintLayout) rootView, textView);
}
String missingId = rootView.getResources().getResourceName(id);
throw new NullPointerException("Missing required view with ID: ".concat(missingId));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment