I am working on RecyclerView and try to using on click listener for each item of recyclcerview using Interface
Here is my Activity cla
class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
public Button btMyButton;
public ViewHolder(View itemView) {
super(itemView);
itemView.setOnClickListener(this);
}
@Override
public void onClick(View v) {
// your implementation. In order to get position you can use `getAdapterPosition()` method
}
}