Serg Burlaka
Serg Burlaka

Reputation: 2496

Butterknife is not working with example

I saw the Butterknife tutorial and it states:

@BindViews({android.R.id.text1, android.R.id.text2})
TextView textEmail,description;

But it isn't working. And I also tried:

@BindViews(android.R.id.text1)
TextView textEmail;

@BindView(android.R.id.text2)
TextView description;

But it's not concise!

Upvotes: 2

Views: 202

Answers (1)

Jiyeh
Jiyeh

Reputation: 5297

I think you might be binding the android ids rather than your view ids.

Change android.R.id.text1 to R.id.yourText.

To group views, you can group them into list/array:

@BindViews({ R.id.first_name, R.id.middle_name, R.id.last_name })
List<EditText> nameViews;

Cheers~

Source: http://jakewharton.github.io/butterknife/

Upvotes: 2

Related Questions