Devrath
Devrath

Reputation: 42824

How to disable the Navigation Bar in android

As Shown in the pic below,

  1. is it possible to disable the navigation bar in android
  2. I am trying to disable all the three functionalities,
  3. Requirement i am working on is a lock screen, so is it possible in android
  4. Any existing answers to support this

enter image description here

Upvotes: 1

Views: 2992

Answers (2)

Sandeep Londhe
Sandeep Londhe

Reputation: 405

You can hide the Action Bar by using following style:

<style name="MyTheme" parent="android:Theme.Holo.Light">
    <item name="android:windowActionBar">false</item>
    <item name="android:windowNoTitle">true</item>
</style>

For Hiding the navigation bar use the following and refer this.

View decorView = getWindow().getDecorView();
// Hide both the navigation bar and the status bar.
// SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as
// a general rule, you should design your app to hide the status bar whenever you
// hide the navigation bar.
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
              | View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

Upvotes: 0

vguzzi
vguzzi

Reputation: 2428

You can hide the navigation bar by doing the following:

View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
          | View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

To make content appear behind the navigation bar you need to use SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION. You may also need to use SYSTEM_UI_FLAG_LAYOUT_STABLE to help your app maintain a stable layout.

You may instead want to use immersive Full-Screen Mode. Check out this link for more info.

Upvotes: 1

Related Questions