9

I'm trying to bind array of strings using butterknife. But seems that there is no way (but in processor there is a method to bind array).

Here is my code:

strings.xml

<string-array name="test_strings">
    <item>VK</item>
    <item>Facebook</item>
    <item>Twitter</item>
    <item>Instagram</item>
    <item>Google plus</item>
    <item>Google mail</item>
</string-array>

MainActivity

@Bind(R.string.test_strings)
protected String [] mStrings;
Anton Shkurenko
  • 4,301
  • 5
  • 29
  • 64
  • 1
    i never use it but ... https://github.com/JakeWharton/butterknife/blob/master/butterknife/src/main/java/butterknife/internal/ButterKnifeProcessor.java#L163 ... @BindArray ? – Selvin Jul 09 '15 at 12:22
  • @Selvin i've found the answer, heh here in the class : https://github.com/JakeWharton/butterknife/blob/master/butterknife/src/main/java/butterknife/BindArray.java#L15 problem was I typed R.string.test_strings, when I should to type R.array.test_strings. Thanks! – Anton Shkurenko Jul 09 '15 at 12:35

1 Answers1

16

Five mins ago Butterknife 8.0.0 was released.

R.string.test_array change to R.array.test_array

And @Bind to @BindArray

Anton Shkurenko
  • 4,301
  • 5
  • 29
  • 64