I'm trying to develop a project in accordance with MVP standarts. In the guide i followed, author created separate ViewHolder class. I tried to do the same, but Adapter refuses to work with separate ViewHolder.

There is 2 errors

> 
> Cannot resolve symbol 'LessonCardView'
> 
> 
> 'onCreateViewHolder(ViewGroup, int)' in RVAdapter clashes with 'onCreateViewHolder(ViewGroup, int)' in 'android.support.v7.widget.RecyclerView.Adapter'; attempting to use incompatible return type
> 
> 
> 

RVAdapter.java

```
public class RVAdapter extends RecyclerView.Adapter<RVAdapter.LessonCardViewHolder> {

    private String[] mDataset;

    public RVAdapter(String[] dataset) {
        mDataset = dataset;
    }

    @Override
    public LessonCardViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new LessonCardViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.lessons_item_card, parent, false));
    }

    @Override
    public void onBindViewHolder(LessonCardViewHolder holder, int position) {

    }

    @Override
    public int getItemCount() {
        return mDataset.length;
    }
}

```

LessonCardViewHolcer.java

```
public class LessonCardViewHolder extends RecyclerView.ViewHolder implements LessonCardView {

    private final TextView lessonCardText;

    public LessonCardViewHolder(View itemView) {
        super(itemView);
        lessonCardText = (TextView) itemView.findViewById(R.id.lesson_card_view);
    }

    @Override
    public void setLessonCardText(String text) {
        lessonCardText.setText(text);
    }
}

```

I created subclass ViewHolder that inherited from LessonCardView in RVAdapter. Errors disappeared. But i'm not sure if this the right way. If it works for someone else, then i'm doing something wrong.