I have a MainActivity
with lots of Fragment
s and in one specific Fragment I want to draw behind system bar, so I'm applying at runtime the following flag :
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
What I want now is when user exits this Fragment
and enters another to remove that flag so there's no content behind status bar. I tried passing null as arguments to setFlags()
method but that's giving an error. I have searched for remove()
or unSet()
methods but none exists. So how should I remove that flag for another Fragment
?