Can't open a fragment from another fragment
问题 I have 5 fragments (home, settings, newPost, notifications and profile) inside my Main2Activity . Inside HomeFragment I have a RecyclerView with a lot of post views, every post containing a "open" button which should open a PostFragment . The problem is, I can only use setOnClickListener in RecyclerViewAdapter class, in populateItemRows() method, so when I can't use getActivity() .. HomeFragment: public class HomeFragment extends Fragment{ private RecyclerView recyclerView; private