1

so i'm writing an app in which i would like the navigation bar in a specific activity to be hidden...and i managed to do so...but my problem is when the user scrolls down the notification bar...when that happens...the navigation bar re-appears...how can i solve this problem?

   final int mUIFlag = View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_IMMERSIVE
            | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
            | View.SYSTEM_UI_FLAG_FULLSCREEN;
    //View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;

    getWindow().getDecorView().setSystemUiVisibility(mUIFlag);
  • Did you try getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); in your Activity? Like @hata said, this is a normal behavior in Android. After a few seconds the navigation bar disappear again – Jorge Casariego Nov 05 '15 at 14:55

1 Answers1

1

when the user scrolls down the notification bar...when that happens...the navigation bar re-appears

I think this behavior is normal and intended as UI design of Android.

Whenever a user swipes-down upper edge or swipes-up bottom edge of screen, both system bar and navigation bar re-appear. Then after a few seconds, they are both disappear again. So as to the user can access system bar or navigation bar whenever they want even if screen is in immersive mode.

can i do anything to disable this? or maybe only hide it

No, generally (without root access) you can't. Only you can do is to hide it. Please refer to these StackOverflow Q&As: Permanently hide navigation bar on activity; Hide System Bar in Tablets.

Community
  • 1
  • 1
hata
  • 11,633
  • 6
  • 46
  • 69