I am using the following method to switch between Fragments (in my NavigationDrawer) by showing / hiding them.
protected void showFragment(int container, Fra
You can use 'onCreateView'(or 'onActivityCreated') and 'onHiddenChanged'. Use 'onCreateView' for first show and use 'onHiddenChanged' for later. 'setMenuVisibility' is not called on transaction control.
@Override
public View OnCreateView() {
// fragment will show first
}
@Override
public void onHiddenChanged(boolean hidden) {
if (!hidden) {
// fragment will show
}
else {
// fragment will hide
}
}