Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Butterknife @InjectView issue after updating to 7

I'm using @InjectView for many of my views. After I updated to the newest version 7 they stopped working? What happened?

like image 954
Shane Avatar asked Jul 06 '15 16:07

Shane


1 Answers

You are experiencing this because Butterknife version 7 has a new set of naming conventions. You'll need to update your code to use the latest annotations.

Change @InjectView to @Bind.

Also change your Java code from Butterknife.inject(); to Butterknife.bind(this). I'm assuming you're doing this in an Activity. If you're doing this in a fragment or have more complicated use scenarios, you should check out the Butterknife documentation here

like image 179
adao7000 Avatar answered Sep 20 '22 06:09

adao7000