I'm using Butterknife for the first time but something must be wrong. I have a fragment and a Listview and a TextView just for testing but Butterknife wont bind my variables:
public class MyFragment extends Fragment {
@Bind(R.id.resultListView) ListView resultList;
@Bind(R.id.textView1) TextView test;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_my, container, false);
ButterKnife.bind(this, view);
System.out.println(resultList); //null
System.out.println(view.findViewById(R.id.resultListView)); //works
System.out.println(test); //null
System.out.println(view.findViewById(R.id.textView1)); //works
return view;
}
}
No exception or anything. Manual binding works so my Views must be there.