Start new Intent from RecyclerViewAdapter
Probably trying to start Activity from onClick
method then use v.getContext()
instead of this
(which refer to onClick method context) as first parameter to Intent constructor :
Intent intent = new Intent (v.getContext(), OnCardSelected.class);
public RecycleViewAdapter(Context context,List<Cards> items, int itemLayout) {
this.mContext = context;
this.items = items;
this.itemLayout= itemLayout;
}
...
Intent intent = new Intent(mContext, YOUR_ACTIVITY.class);
mContext.startActivity(intent)
Add this line of code in your onBindViewHolder method
Intent intent = new Intent(v.getContext(), YourClassName.class);
v.getContext().startActivity(intent);
And you're good to go.