1

I have a problem hiding navigation bar at the bottom of the screen in android. Every solution I've tried doesn't work exactly as I want it to work, except one. Modifying build.prop with new entry 'qemu.hw.mainkeys=1' worked ok, but it disables navigation bar for whole android system. Is there possibility to disable navigation bar like this only for one app?

blackadd3r
  • 13
  • 6
  • 1
    Possible duplicate of [Permanently hide navigation bar on activity](http://stackoverflow.com/questions/16713845/permanently-hide-navigation-bar-on-activity) – Will Evers Nov 05 '15 at 16:36

2 Answers2

0

Try 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);
(Source)
Muhammad Ali
  • 3,478
  • 5
  • 19
  • 30
0
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
decorView.setSystemUiVisibility(uiOptions);

Use this code in onCreate(), it will hide status bar and navigation bar until users swipe down from top of the screen