0

I have an Android device with root privileges (out-of-the-box). I am trying to hide the nav bar so the home and back buttons are not visible. I am performing this task using the following:

proc = Runtime.getRuntime().exec(new String[]{"su","-c","service call activity "+ ProcID +" s16 com.android.systemui"}); 

where ProcID = "42"

This works on my root Samsung Galaxy Tab 2, but does not work on this particular Android device (OS v4.2.2).

Any guidance would be appreciated. There are no errors encountered unless I run this on a non-root device.

Roy Hinkley
  • 10,111
  • 21
  • 80
  • 120
  • This is not a public API, so you cannot expect it to work consistently on all devices. If you are really trying to make a secured Kiosk, you should be prepared to make source-level changes to Android itself, not merely barge around at runtime doing things as root. Merely hiding the nav bar is nowhere near sufficient, either. – Chris Stratton Feb 22 '15 at 18:04
  • I finally found this post: http://stackoverflow.com/questions/16713845/permanently-hide-navigation-bar-on-activity on SO that resolves my issue. – Roy Hinkley Feb 24 '15 at 15:31

1 Answers1

0

Are you trying to make your app running on a full screen like games? Try using immersive mode sticky. Like:

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

You can get more info from here: https://developer.android.com/training/system-ui/immersive.html

Hope thats what youre looking for

ATM
  • 1
  • I think this only achieves lights-out-mode. I need to actually disable the navigation altogether. This is going into a kiosk and access must be restricted. – Roy Hinkley Feb 18 '15 at 17:42
  • To confirm, this is `not what I am looking for`. While it hides the navigation, it can be displayed by double-tapping the app. The Navbar should never be accessible by an unauthorized user. – Roy Hinkley Feb 18 '15 at 17:58