StickyHeader Views are unaccessible
I am trying to add a StickyHeaderView along with Parallex header using item decorator,
The Layout is added and it works fine however no views inside headerView are accessible
Here is the standard code
@Override public long generateHeaderId(int position) { if (getItem(position) != null) return getItem(position).id; else return -1; }
@Override public HeaderViewHolder onCreateHeaderViewHolder(ViewGroup viewGroup) { View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.listview_header_profile, viewGroup, false); // initializing views and then let's say setting onClicks, setText to textViews nothing seems to work strangly. LinearLayout nationLayout = (LinearLayout) view.findViewById(R.id.nationsLayout);
nationLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { moodLayoutClick.moodLayoutClicked(Constants.MOOD_TYPE_NATION); } });
return new HeaderViewHolder(view);
}@Override public void onBindHeaderViewHolder(RecyclerView.ViewHolder viewHolder, int position) {
}public class HeaderViewHolder extends RecyclerView.ViewHolder { protected TextViewWithFont nationBtn; //
HeaderViewHolder(View view)
{
super(view);Tried initializing here too. Doesn't work } }
What actually is going on? Source: cymcsg/UltimateRecyclerView