android - want to include Fragments under tabFragment -
i have activity has navigation drawer , tabview viewpager. want open fragments inside tabview according selection in navigation drawer. how navigate fragments according selection
mnavigationview.setnavigationitemselectedlistener(new navigationview.onnavigationitemselectedlistener() { @override public boolean onnavigationitemselected(menuitem menuitem) { mdrawerlayout.closedrawers(); if (menuitem.getitemid() == r.id.ap) { fragmenttransaction fragmenttransaction = mfragmentmanager.begintransaction(); fragmenttransaction.replace(r.id.containerview, new fpfragment()).commit(); } if (menuitem.getitemid() == r.id.vfp) { fragmenttransaction xfragmenttransaction = mfragmentmanager.begintransaction(); xfragmenttransaction.replace(r.id.containerview, new veryfinfrag()).commit(); }
is possible??
Comments
Post a Comment