Search code examples
androidhideshow-hidenavigationbar

How to Hide Navigation Bar Permanently in Android


I am trying to hide navigation bar at bottom in my app.

With following code in my onCreate I can hide it. But when I press screen or press volume buttons it comes up again.

View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

How can I permanently hide navigation bar.


Solution

  • Hi I did it with using

    View.SYSTEM_UI_FLAG_IMMERSIVE and

    SYSTEM_UI_FLAG_HIDE_NAVIGATION flags same time.

    It requires 4.4 but my version is 4.2.2.

    Thats why I couldn't do it before. Thank you all for your answers and consern.