Unable to solve constructor applied to given types

Viewed 64

I am doing a Semester project of our own app development. I am making a Recipe/Restaurant app. The issue is that in my Restaurant.java is unable to get the RestaurantAdapter -> public void setFilteredList as it has come with an error I am unable to solve after referring to previous error.

The current error I got was:

constructor RestaurantAdapter in class RestaurantAdapter cannot be applied to given types

Error message

enter image description here

These are the Java and XML files that are used:

The java class:

1st half

enter image description here

2nd half

enter image description here

error part:

else{
RestaurantAdapter restaurantAdapter = new RestaurantAdapter();
restaurantAdapter.setFilteredList(filteredList);
}

RestaurantAdapter:

Adpapter part 1

enter image description here

Adpapter part 2

enter image description here

Apologies if the response is scuffed, this is my first time posting. Greatly appreciate the help!

1 Answers

Check this

else{
    RestaurantAdapter restaurantAdapter = new RestaurantAdapter(getApplicationContext(),filteredList);
    restaurantAdapter.setFilteredList(filteredList);
 }
Related