Hide Navigation Bar from Android Screen Activity

By default every Android Activity that will you create will have a Navigation Bar or so-called "The Status Bar" (Update 2018: This is not true anymore - you can select a completely blank template with no Navigation Bar while creating a new project using Android Studio) this bar displays the title of the Activity, you might be working on a scenario where you want to have a full-screen display for your app, this can be done in two ways - by using the XML property or programmatically using Java/Kotlin code.

Activity with Title\Navigation Bar
Activity with Title\Navigation Bar

Method 1: Using AndroidManifest.xml

To hide the title bar and the navigation bar from an Android Activity to make your App utilize full screen, all we need to do is add the following attribute to the Activity tag(in AndroidManifest.xml) which needs no title bar.


Below is how the activity code will look like,

       android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
          <action android:name="android.intent.action.MAIN" />
           <category android:name="android.intent.category.LAUNCHER" />

If you want to make your whole application as full screen then use the below code snippet in the App Manifest file.

    android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen" >

This is the most preferred way of setting your Activity full screen using Manifest XML file as it's easy to maintain.

This is an old post, as Android development have evolved maybe this may not hold true if you are on Android 4.0 or above (API 14), if you want to do the same thing using Java code this can be achieved as following,

Method 2: Using Java/Kotlin Code

Using the code you can archive this using the WindowManager flags. You may want to use this approach if you want to toggle between hiding and showing status bar based on user interaction with the activity.

If the Android version is lower than Jellybean i.e. API 16 or lower,

public class MyActivity extends Activity {

    protected void onCreate(Bundle savedInstanceState) {

        if (Build.VERSION.SDK_INT < 16) {

class MyActivity : Activity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        if (Build.VERSION.SDK_INT < 16) {

If the Android version is 4.1 or higher,

View decorView = getWindow().getDecorView();
Android Activity without title bar
Android Activity without title bar

If you just want to hide the title bar, you can use: this.requestWindowFeature(Window.FEATURE_NO_TITLE);


  • Nowadays Google provides pre-set templates for your application if you are using Android Studio!

    > admin: Thanks, I have updated the text of this post with this note!
    userAnon 11 Jun 2020 11:11:23 GMT
  • Further comments disabled!

Have Questions? Post them here!
Try Out Code2care Dev Tools:


Android Java Linux Microsoft Google Python macOS Notepad++ Microsoft Teams CSS PHP SharePoint Html Linux C Programs Bootstrap jQuery Sublime Android Studio Facebook Eclipse WhatsApp News MySQL Json HowTos JavaScript FTP S3


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Tutorials, Trouble-Shooting steps, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.
🎉 We are celebrating the 10th years of Code2care! Thank you for all your support! We hope we made a difference.
We strong support Gender Equality & Diversity.

We stand in solidarity with Ukraine - Make a donation to UNHCR - https://donate.unhcr.org/in/en-in/ukraine-emergency