ebarrenechea / header-decor

A couple of sticky header decorations for android's recycler view.
Apache License 2.0
878 stars 159 forks source link

Header item's child click event #33

Closed riontech-xten closed 8 years ago

riontech-xten commented 8 years ago

header item's child click is not working

here is my code public HeaderViewHolder(View itemView) { super(itemView); this.textView = (TextView) itemView.findViewById(R.id.txtDateSection); itemView.findViewById(R.id.imgClickTest).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(context, "Position=>"+ getAdapterPosition(), Toast.LENGTH_LONG).show(); } }); }

ebarrenechea commented 8 years ago

You have to check for click events by implementing RecyclerView.OnItemTouchListener. This was already discussed on issue #26 so please refer to that thread for the information you need.