How to disable drawer option in specific fragments of an activity
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? MichaelStoddart Put two methods in the your activity , one to disable the drawer and one to enable it again, like so: public void lockDrawer() { drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); } public void unlockDrawer() { drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED); } Then in your fragments onCreateView(...)