In my NavigationView I have a header layout with id \'viewId\' with active buttons. To setup those buttons, I do the following in activity\'s onPostCreate
:
This is how I did it using ButterKnife
and it works for me.
protected static class HeaderViewHolder {
@BindView(R.id.button)
Button button;
HeaderViewHolder(View view) {
ButterKnife.bind(this, view);
}
}
and then use this view holder like this :
View header = navigationView.getHeaderView(0);
headerViewHolder = new HeaderViewHolder(header);