Difference between bind and injectView in butterknife

I use a library with oil. I do not know how to use it. I found that injectView and bind do the same thing, but I'm not sure. Can anyone explain the difference between the two.

+7
android butterknife
source share
3 answers

Can anyone explain the difference between the two?

@InjectView been changed to @Bind .

Label the fields with @Bind and the view ID for Butter Knife to find and automatically display the corresponding view in your layout.

 class YourActivity extends Activity { @Bind(R.id.TvTitle) TextView title; 

Please check the links below. Hope this helps.

GRADLE

 compile 'com.jakewharton:butterknife:7.0.1' //8.4.0 

https://github.com/JakeWharton/butterknife/blob/f65dc849d80f6761d1b4a475626c568b2de883d9/CHANGELOG.md

+10
source share

If I am not mistaken, they have the same function. A change has been made to the naming convention, since butterknife version 7, injectView been changed to bind .

Check changelog , also check this problem .

Check out this link: How to use butterknife

+7
source share

Starting with version 8.0.0, @Bind becomes @BindView and @BindViews

See the change log for beginners for more information.

0
source share

All Articles