I know this question has been asked a million times before, but I have tried all of the solutions I can find, and still doesn\'t work. I have tried calling \"this\" for context,
You should pass an array of Review
not an array of Reservation
. So change your adapter to ArrayAdapter
.
Also, at the moment you call the getActivity()
method inside the onCreateView()
method your Activity
is not created yet, which can cause an error.
To solve this issue, you should to move this line to your onActivityCreated()
:
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
context = getActivity();
}