I am using butterknife library. I don't know much about how to use it. I found injectView and bind doing the same thing but I am not really sure. Can anyone explain the difference between these two.
Asked
Active
Viewed 8,182 times
3 Answers
10
Can anyone explain the difference between these two ?
@InjectView
was changed to @Bind
.
Annotate fields with @Bind and a view ID for Butter Knife to find and automatically cast the corresponding view in your layout.
class YourActivity extends Activity {
@Bind(R.id.TvTitle) TextView title;
Please check below links. Hope this helps .
GRADLE
compile 'com.jakewharton:butterknife:7.0.1' //8.4.0

Community
- 1
- 1

IntelliJ Amiya
- 74,896
- 15
- 165
- 198
-
1One more thing. I am using android studio. Here its only showing @InjectView but not Bind. – Rookie Feb 01 '16 at 05:43
-
`@Bind(R.id.TvTitle) and ButterKnife.bind(this);` http://stackoverflow.com/questions/28138859/android-studio-integrating-butterknife – IntelliJ Amiya Feb 01 '16 at 05:46
-
1Oops! I was using version 5.x.x. – Rookie Feb 01 '16 at 05:47
7
If I'm not mistaken, they have the same function. There was a change in naming convention starting version 7 of butterknife, injectView
was changed to bind
.
Check the changelog, also check this issue.
Check this link: How to use butterknife

hehe
- 1,294
- 13
- 26
0
As of Version 8.0.0 @Bind becomes @BindView and @BindViews
Check the butterknife changelog for further information!

Mahpooya
- 529
- 1
- 6
- 18