I have a horizontal recycleview inside vertical recycleview.
and i add list cardview inside horizontal rec
It would be better to implement OnClickListener
on your ViewHolder
class and add the listener to your desired views.
Just in onBindViewHolder(...)
add setOnClickListener(...)
like this:
@Override
public void onBindViewHolder(WordViewHolder holder, final int position) {
//...
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(v.getContext(), position + "", Toast.LENGTH_SHORT).show();
}
});
}