In the fragment I try to access specific classes of my application.
private void initializeAdapter() { Adapter adapter = new Adapter(persons, new Adapter.OnRVItemClickListener(){ @Override public void onRVItemClick(int position) { Intent intent = null; switch(position){ case 0: intent = new Intent(getActivity(), MainActivity.class); break; case 1: intent = new Intent(getActivity(), MainActivity.class); break; default: intent = new Intent(getActivity(), CustomIntro.class); break; } getActivity().startActivity(intent); } }); recyclerView.setAdapter(adapter); } Produces the following error:
