I'm trying to hide status bar in fragment. I have successfully hidden toolbar but I want to hide status bar also only in one fragment..
@Override
public void onCreate(Bundle arg0) {
super.onCreate(arg0);
// requestWindowFeature(Window.FEATURE_NO_TITLE);
((HomeActivity)getActivity()).getSupportActionBar().hide();
}
Above code working fine for hide toolbar
requestWindowFeature(Window.FEATURE_NO_TITLE);
If I requestWindowFeature
in fragment onCreate
(has mentioned above) application was crashed.
Added three screenshots after implementing answer by @Mathan Chinna
@Lalit Singh Fauzdar answer to hide statusBar is correct. if u want to show statusBar u can use
View decorView = getActivity().getWindow().getDecorView(); // Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
decorView.setSystemUiVisibility(uiOptions);