I want to call a Fragement from my BaseAdapter Class. In this class I have button on click of which I want to call the new fragment, but I am not able to get this. I have to
FragmentManager manager = ((AppCompatActivity) context).getSupportFragmentManager(); FragmentTransaction fragmentTransaction = manager.beginTransaction(); fragmentTransaction.replace(R.id.content_frame, new AlbumFragment()); fragmentTransaction.addToBackStack(null); fragmentTransaction.commit();