How to programmatically remove/hide the system bar in Honeycomb (requires root)

Without the system bar it is almost impossible to control your Honeycomb tablet. Since no hardware control buttons are enforced for the tablet the system bar is the only way to control your slate.

However, if your application incorporates a way of removing the bar and on leaving restarting the bar there is no reason why not to support such a feature.

The easy part: Restarting the bar

Restarting the bar is pretty simple, drop to a shell and start the service using the “am” command:
# am startservice -n

The difficult part is to shut it permanently down. One way is to navigate to the application settings and shut it down with the “force close” button. However, attempting to kill the process with

# killall

will remove the bar for a few seconds. Sadly, it will return eventually since in the applications manifest file the “persistent” parameter enforces the system to restart the service unless it is shut down properly by the “system” user itself.

The following magic line will shut down the bar permanently if executed as root:

# service call activity 79 s16

What it does is sending the Activitymanager a shutdown signal for the systemui service.
This method was tested on an Iconia A500 with Android 3.01; although it should work with other devices as well (since the source code that we use is common).

Putting it together

To remove the system bar from your application create and execute a process:

Process proc = Runtime.getRuntime().exec(new String[]{"su","-c","service call activity 79 s16"});

To restore the system bar use the following code snippet:

Process proc = Runtime.getRuntime().exec(new String[]{"am","startservice","-n",""});

28 Replies to “How to programmatically remove/hide the system bar in Honeycomb (requires root)”

    1. Sadly there are no sources of honeycomb available yet. It will get released when Ice Cream Sandwich is out and we are pretty confident to see a build after the release.

  1. @Mark Murphy: I see your point there, but I also doubt this is a bug. I just wish Android had a way to put devices in some kind of “Kiosk Mode” without having to jump so many hoops, especially when the source code for Honeycomb is not available yet, otherwise I would be happy to build a custom version of Android just for kiosks.

  2. Awesome job guys!
    The only thing I wonder about: If there is a method to know if the service is already running?


  3. Oh, and as a heads up the method to restore the status bar does not work in Android 2.3.4 Gingerbread, but the one to remove it does. Instead I changed “” to “” and things worked great on my rooted Motorola Droid 3.

  4. Hey,

    I want in my app two buttons: One for showing, one for hiding the system bar.
    So I copied the code from above to the button, added a try catch block but nothing happens. Any hints?

    thx B770

  5. This method does NOT work on Android 4.0 Ice Cream Sandwich. The problem is that the StatusBarService is wed to SystemUI, but moreover that the launcher and a few other components are also interconnected. If you kill the SystemUI process then you will just get FC after FC until your device hot-reboots.

  6. Hi, Thomas Barrasso!

    I did as you suggested (see quoted below), but still, it was not able to restore the status. Any idea? Thanks in advance!

    >> Oh, and as a heads up the method to restore the status bar does not work in Android 2.3.4 Gingerbread, but the one to remove it does. Instead I changed “” to “” and things worked great on my rooted Motorola Droid 3.

  7. Hi,
    I’d like to release only touches the buttons back, home and menu in our application, but without using the root, for warranty issues. Does anyone have any idea how to do it?

  8. I noticed that to make this work, you need to keep the USB Debugging checkbox checked. If I disable it, my app hangs…

  9. Hi Manuel, great post!

    I’ve detected the same problem. I need to keep the USB Debugging enabled. My application hangs after restart the toolbar. Hide process works perfect.

    It is possible to fix it?

    Thank you

  10. Hi all, maybe I have a method to disable the system bar in ICS. We can move the file ‘SystemUI.apk’ & ‘SystemUI.odex’ to other folder, then restart our device and it works. If u want to enable it, u move these two files back and restart. It’s the only way I found in last two month.

  11. Hey, thanks Manuel Di Cerbo for that bit of code, and also thanks Thomas Barrasso! that extra bit worked for me to reveal the notification bar…on cyanogenmod 7.1 (gb 2.3)

    awesome, thanks guys!

  12. Hey thanks for this
    The shell command works perfectly on my device. But when I run your Android code it’s not working. No error but nothing happens.

    I have a 4.4.4 custom ROM I built with AOSP. Could that be the reason ?

  13. the android phone that I have is freezing up and I have taken the battery out for at least 15 minutes and put it back in but it is still doing the same thing

Leave a Reply

Your email address will not be published. Required fields are marked *