How to Hide Status Bar Android Java

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);

 

, ,

Post navigation

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.