Hide Status bar on Android Ice Cream Sandwich

后端 未结 6 1016
醉梦人生
醉梦人生 2020-12-23 18:14

I\'m working in a launcher for Android ICS but I have a problem with tablets.

I can\'t hide the status bar. I have try it in Android 2.3.X and it\'s ok. The problem

6条回答
  •  执念已碎
    2020-12-23 18:32

    I know my answer comes a bit late, but after assembling info from various places, I came up with this, which works ONLY ON ROOTED DEVICES:

        private void    KillStatusBar()
    {
        Process proc = null;
    
        String ProcID = "79"; //HONEYCOMB AND OLDER
    
        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH){
            ProcID = "42"; //ICS AND NEWER
        }
    
        try {
            proc = Runtime
                    .getRuntime()
                    .exec(new String[] { "su", "-c",
                            "service call activity "+ProcID+" s16 com.android.systemui" });
        } catch (IOException e) {
            Log.w(TAG,"Failed to kill task bar (1).");
            e.printStackTrace();
        }
        try {
            proc.waitFor();
        } catch (InterruptedException e) {
            Log.w(TAG,"Failed to kill task bar (2).");
            e.printStackTrace();
        }
    
    }
    

    This should eliminate the bottom bar on any rooted device and turn it into "kiosk" mode.

提交回复
热议问题