How to hide and show android status bar programmatically
To hide the status bar, go to the activity’s java file and enter the following code in the Oncreate method
Java Android code to hide status bar
To hide the status bar
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
To show the status bar, use this code
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);