I want to set OnClickListeners to the items from my Expandable Recycleview. Each item from the Recycleview should have a button ( like this <https://imgur.com/qlEJCkk> : a + button to add tasks and an "x" button for each task to delete it)

I have tried to implement it from some other examples of onClickListeners but nothing worked so far

this is the ADAPTER:

```
public class ExpandableAdapter extends ExpandableRecyclerViewAdapter<RoutineViewHolder, TaskViewHolder> {
    public ExpandableAdapter(List<? extends ExpandableGroup> groups) {
        super(groups);
    }

    @Override
    public RoutineViewHolder onCreateGroupViewHolder(ViewGroup parent, int viewType) {
        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.expandable_recyclerview_routine, parent, false);
        return new RoutineViewHolder(v);
    }

    @Override
    public TaskViewHolder onCreateChildViewHolder(ViewGroup parent, int viewType) {
        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.expandable_recyclerview_task, parent, false);
        return new TaskViewHolder(v);
    }

    @Override
    public void onBindChildViewHolder(TaskViewHolder holder, int flatPosition, ExpandableGroup group, int childIndex) {
        final Tasks tasks = (Tasks) group.getItems().get(childIndex);
        holder.bind(tasks);

    }

    @Override
    public void onBindGroupViewHolder(RoutineViewHolder holder, int flatPosition, ExpandableGroup group) {
        final Routine routine = (Routine) group;
        holder.bind(routine);

    }

```

RoutineViewHolder:

```
import com.thoughtbot.expandablerecyclerview.viewholders.GroupViewHolder;

public class RoutineViewHolder extends GroupViewHolder implements View.OnClickListener {
    private TextView mTextView;

    public RoutineViewHolder(View itemView) {
        super(itemView);

        mTextView = itemView.findViewById(R.id.exp_routine);
        itemView.setOnClickListener(this);
    }

    public void bind(Routine routine){
        mTextView.setText(routine.getTitle());
    }

}

```

TaskViewHolder:

```
public class TaskViewHolder extends ChildViewHolder {
    private TextView mTextView;
    private CheckBox mCheckBox;
    private Boolean checkVal;

    public TaskViewHolder(View itemView) {
        super(itemView);
        mTextView = itemView.findViewById(R.id.exp_task);
        mCheckBox=itemView.findViewById(R.id.exp_task_checkbox);
    }

    public void bind(Tasks tasks) {
        mTextView.setText(tasks.name);
        checkVal=((tasks.checkBox==1)?Boolean.TRUE:Boolean.FALSE);
        mCheckBox.setChecked(checkVal);
    }
}

```

as you can see I have 2 ViewHolders : RoutineViewHolder and TaskViewHolder. I am very confused to where and how I should set the OnClickListener since I want it to behave different for the "Routines" and "Tasks" because they would have different buttons.

"Tasks" should have the + button to add tasks underneath it 
and each task should have an X button to delete that specific task

the expandable recycleview is made out of 2 more of these "Tasks" cathegories.