In my Adapter I want to Navigate different fragments
public NavAdapter(Context context, ArrayList<NavItems> navItems) {
this.navItems = navItems;
this.context = context;
}
in above adapter Constructor I managed to get context , how to get the fragmentManager ?
答案 0 :(得分:0)
YourActivity mainActivity = (YourActivity) context;
FragmentManager manager = mainActivity.getSupportFragmentManager();
You can use this to get FregmantManager and perform the transaction .