How to hide the bottom system bar in an Android tablet

I am developing an application only for tablets, where you need to run the application on the full screen of the tablet.

For this, I used the following code in my main action:

getWindow().requestFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);

This piece of code only removes the title bar and action bar. But tablets have a lower system panel (with a home and back button). I also want to remove or hide this system panel too.

I searched, but there is only the following solution:

  • There is no API to remove or hide the system panel.
  • You can use the Android application to hide the system panel. (for example: confident, hidden, etc.)

My question is:

  • Is this possible in android?
  • An upcoming application (e.g. locklock, hide bar, etc.) also hides the bar. This means that they are using something for this. You can use this something in our application, so the user does not need to download these app seperatly.

I beg you, please.

I know this is not a good idea. But my application is only for tablets with Android 4.0 or higher, and that the tablet will only launch one application, so we do not need to go back and use the home button. . Therefore, my requirement is to use the application in full screen.

+5
source share
5 answers

If you have root access, you can use this code in another way, this is not allowed

try{
    //REQUIRES ROOT
    Build.VERSION_CODES vc = new Build.VERSION_CODES();
    Build.VERSION vr = new Build.VERSION();
    String ProcID = "79"; //HONEYCOMB AND OLDER

    //v.RELEASE  //4.0.3
    if(vr.SDK_INT >= vc.ICE_CREAM_SANDWICH){
        ProcID = "42"; //ICS AND NEWER
    }



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

}catch(Exception ex){
    Toast.makeText(getApplicationContext(), ex.getMessage(), Toast.LENGTH_LONG).show();
}

+9

Android API 4.0 , .

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

, root. , launcher application.

"/".

+5

4.2, :

:

Runtime.getRuntime().exec("service call activity 42 s16 com.android.systemui");

Or use 79 instead of 42 for APIs less than 14. You may also need to enable SET_DEBUG_APP permission, in which case you need the application to sign with the system key or installed in the / system / app / directory.

Show:

Runtime.getRuntime().exec("am startservice --user 0 -n com.android.systemui/.SystemUIService");

In addition, some people used the -a option (instead of -n), although this caused an error on my device:

Error: not found; the service did not start.

0
source

android: immersive = "true" will hide the bottom panel of the system

<application> 
 <activity
        android:name=".CarrierActivity"
        android:label="@string/app_name"
        android:excludeFromRecents="true"
        android:immersive="true"
        android:configChanges="orientation|keyboardHidden|screenSize">
        <intent-filter>
         <action android:name="com.example.SetupWiz.SUW_CARRIER"/>
         <category android:name="android.intent.category.DEFAULT" />
       </intent-filter>
    </activity>
</application>  
0
source

All Articles