Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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