How to Hide Title Bar in Android Studio
Skip to main content

How to Hide Title Bar in Android Studio

 How to Hide Title Bar in Android Studio

In this Tutorial we discuss about How to Hide Title Bar in Android Studio. We write a simple code to hide title bar in android studio and how to display shown in full  android mobile screen.

  • First Method, In side of our project Main Activity we write in code in Java class. Where we write a requestWindowFeature(Window.FEATURE_NO_TITLE) method call before the setContentView(). There is we check there is Title Bar exits or not so we use a condition to check title bar is null or not. 
    
How to Hide Title Bar in Android Studio, How to remove action bar in Android Studio, How to hide toolbar in Android programmatically, Hide status bar Android

The getSupportActionBar() method is use to retrieve the instance of the ActionBar class and after we calling the hide method for hiding the ActionBar.

How to Hide Title Bar in Android Studio, How to remove action bar in Android Studio, How to hide toolbar in Android programmatically, Hide status bar Android

Output on UI Screen:-

How to Hide Title Bar in Android Studio, How to remove action bar in Android Studio, How to hide toolbar in Android programmatically, Hide status bar Android

  • Second Method, We define a theme inside the manifest.xml file for hide the ActionBar by write a android:theme=”@style/Theme.HelloApplication.NoActionBar”

How to Hide Title Bar in Android Studio, How to remove action bar in Android Studio, How to hide toolbar in Android programmatically, Hide status bar Android

Set a Flag for Full Screen in Android:

    There is we write a code for activity show on Full Screen. We use a setFlag() method which is belongs to the Window class. We pass a parameter WindowsManager.LayoutParams.FLAG_FULLSCREEN into the setFlag() method. 

How to Hide Title Bar in Android Studio, How to remove action bar in Android Studio, How to hide toolbar in Android programmatically, Hide status bar Android

Output:-

How to Hide Title Bar in Android Studio, How to remove action bar in Android Studio, How to hide toolbar in Android programmatically, Hide status bar Android










 



Post a Comment

0 Comments