My project contains one MainActivity and 6 Fragments. I would like to have the layout set to fit system window for 1 certain fragment and not others. So what I did is I put this code
getActivity().findViewById(R.id.coordinatorLayout).setFitsSystemWindows(true);
inside the onResume method in that one fragment and
getActivity().findViewById(R.id.coordinatorLayout).setFitsSystemWindows(false);
inside the onResume method in others.
Turn out that the method
setFitsSystemWindows(false)
works but thesetFitsSystemWindows(true)
does nothing
The application view still set to not fit System Windows after calling setFitsSystemWindows(true)
so I would like to know if I've done anything wrong or the method just can't work.
Thank you in advance. Any answer will be appreciated.
UPDATE: I call .getFitsSystemWindows() after calling .getFitsSystemWindows() and it return true -- without doing the task.