Use @Bind property in ButterKnife as mentioned below.
@BindDrawable(R.drawable.ic_expand_small_holo_light) Drawable mExpandDrawable;
and in onCreate after setContentView method is called, use bind method of ButterKnife (If you are using Activity).
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_activity);
ButterKnife.bind(this);
// TODO Use fields...
}
If you are using Fragment, use the below code to initialize ButterKnife:
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fancy_fragment, container, false);
ButterKnife.bind(this, view);
// TODO Use fields...
return view;
}