Android4.0 flat panel development Hidden Bottom task bar method _android

Source: Internet
Author: User

The example in this article describes the way to hide the bottom taskbar of Android4.0 flat panel development. Share to everyone for your reference, specific as follows:

Copy Code code as follows:
GetWindow (). Getdecorview (). setsystemuivisibility (view.system_ui_flag_hide_navigation);//Hide Bottom taskbar code

The top is validated

Baidu came in below

Showbar display taskbar

Closebar Hide Task bar

Prerequisite: Root Permission Required

 public static void Showbar () {try {Process proc = runtime.getruntime (). EXEC ( New string[] {"AM", "StartService", "-N", "com.android.systemui/." 
     Systemuiservice "}); 
   Proc.waitfor (); 
   catch (Exception e) {e.printstacktrace (); The public static void Closebar (context context) {try {//Require root permission build.version_codes VC = new Buil 
     D.version_codes (); 
     Build.version VR = new build.version (); 
String procid = "79"; if (VR. Sdk_int >= VC. Ice_cream_sandwich) {procid = "n";//ICS and newer}//requires root permission Process proc = Runtime.getrunti Me (). EXEC (new string[] {"Su", "C", "Service call activity" + ProcID + "S16 Co M.android.systemui "}); 
   was Proc.waitfor (); 
   The catch (Exception ex) {Toast.maketext (context, Ex.getmessage (), Toast.length_long). Show (); } 
}

1.ActionBar:

<activity android:name= "Demo"
   android:label= "@string/app_name"
   android:theme= "@android: style/ Theme.NoTitleBar.Fullscreen ">
 <intent-filter>
  <action android:name=" Android.intent.action.MAIN "/>
  <category android:name= android.intent.category.LAUNCHER"/>
 < /intent-filter>
</activity>

2. TitleBar

Hide:

Copy Code code as follows:
Requestwindowfeature (Window.feature_no_title);

Or
Copy Code code as follows:
Android:theme= "@android: Style/theme.black.notitlebar

Show:
Copy Code code as follows:
Requestwindowfeature (Window.feature_custom_title);

3.NotificationBar, StatusBar, Systembar

Dim words Can:

GetWindow (). Getdecorview (). Setsystemuivisibility (
 view.system_ui_flag_low_profile); 

Hidden words can (not, haha):

GetWindow (). Getdecorview (). Setsystemuivisibility (
 view.system_ui_flag_hide_navigation);

How do you play that? Use ruthless strokes, haha:

Command-line method:

Kill directly with process number, do not add service that shell, a systembar will start.

# Kill Com.android.systemui
# Service call activity-S16 Com.android.systemui

If you want to start Systembar:

Copy Code code as follows:
# AM Startservice-n com.android.systemui/. Systemuiservice

Code mode:

to root.

Process proc = Runtime.getruntime (). EXEC (new string[]{"Su", "-C", "Service call activity,"
 s16 com.android.systemui "});
Proc.waitfor ();
Process proc = Runtime.getruntime (). EXEC (new string[]{"AM", "StartService", "-N", "com.android.systemui/." Systemuiservice "});
Proc.waitfor ();

I hope this article will help you with the Android program.

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.