I have a mainactivity where I have created a method to lock/unlock the drawer_layout and locked it in the onCreate()
method.
public void disableDrawer(Boolean bol){
if(bol) {
mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_OPEN);
mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
}else{
mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
}
}
and after checking if the user is logged in or not i want to unlock the drawer from the fragment.
I tried to do this in onActivityCreated but the drawer is still locked
MainActivity activity = ((MainActivity)getActivity());
activity.disableDrawer(false);
in short
DrawerLayout.LOCK_MODE_UNLOCKED
doesn't unlock DrawerLayout
...
any help would be appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…