What I have: I have a RecyclerView with images of bars, coffee shops. etc
What I want: That when you click on one of these images I show you the info of the selected pla
I think you forget to pass context from activity !
AdapterDatos adapter = new AdapterDatos(foodAndGo.this,listalugares);
Receive context in Adapter :-
public AdapterDatos(Context context , ArrayList<ClaseNueva> listalugares) {
this.context = context;
this.listalugares = listalugares;
}
I hope this help you!
You need to fetch the context in adapter. I've another solution for. You can get context using the code below
context = holder.foto.getContext();
So, we will get context from foto component in adapter. Lets try!
UPDATE
You need to put that code in onBindViewHolder and above
if (position == 0){