I have an activity with 5 fragments, I used drawer layout in my activity for a drawer, but I want to use(enable) the drawer in only fragment 2 and I want to disable the drawer option in remaining fragments.
Can any one help me how to do this?
I have an activity with 5 fragments, I used drawer layout in my activity for a drawer, but I want to use(enable) the drawer in only fragment 2 and I want to disable the drawer option in remaining fragments.
Can any one help me how to do this?
Put two methods in the your
activity
, one to disable thedrawer
and one to enable it again, like so:Then in your
fragments
onCreateView(...)
method put:for the
fragments
where thedrawer
should stay shut and for thefragments
where thedrawer
should stay open put:P.S: for tutorials in how to correctly implement a
fragment
interaction listener see:https://developer.android.com/training/basics/fragments/communicating.html