ListFragment
is not a Context
. First change it to use the attached Activity
as Context
, and then move it into the onCreate()
method of the Fragment because before this call there might not be an Activity
attached. (actually it's after the onAttach(Activity)
call)
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate();
TestAdapter adapter = new TestAdapter(getActivity());
...
{