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

Source: Internet
Author: User

Original address http://android.serverbox.ch /? P = 306

 

 

 

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 inreceivates a way of removing the bar and on leaving
RestartingThe 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 com.android.systemui/.SystemUIService

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

# killall com.android.systemui

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 com.android.systemui

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 shoshould 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 com.android.systemui"});
proc.waitFor();

To restore the system bar use the following code snippet:

Process proc = Runtime.getRuntime().exec(new String[]{"am","startservice","-n","com.android.systemui/.SystemUIService"});
proc.waitFor();

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.