Skip to content

Instantly share code, notes, and snippets.

@ChaitanyaPramod
Created March 25, 2018 20:56
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 ChaitanyaPramod/b3fe2b858fe9b47ec4d975cb3343098a to your computer and use it in GitHub Desktop.
Save ChaitanyaPramod/b3fe2b858fe9b47ec4d975cb3343098a to your computer and use it in GitHub Desktop.
public class MyActivity extends Activity {
@BindView(R.id.my_text_view) TextView myTextView;
private Unbinder unbinder;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// instead of reflection using
unbinder = Butterknife.bind(this);
// you can write
unbinder = new MyActivity_ViewBinding(this);
myTextView.setText("Ta-da!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment