I suppose that the elements added to the Array are dynamically, otherwise you can simply declare them in your header one by one and afterwards add them to the array:
// in the header:
@InjectView(R.id.imageview1) ImageView imageView1;
@InjectView(R.id.imageview2) ImageView imageView2;
@InjectView(R.id.imageview3) ImageView imageView3;
// inside your code:
ImageView activityImageViews[] = {
imageView1, imageView2, imageView3
};
But however, if the elements are dynamic (in amount of elements/id of elements etc.) the only thing you can do is to use ButterKnife.findById
which will spare the ImageView
cast - you can't inject them via annotation because Butterknife does not know what to generate/inject on compile time (the information is first available on runtime).
ImageView activityImageViews[] = {
ButterKnife.findById(view, R.id.img_activity_1),
ButterKnife.findById(view, R.id.img_activity_2),
ButterKnife.findById(view, R.id.img_activity_3),
ButterKnife.findById(view, R.id.img_activity_4)
};