Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide Tablet system bar

I want to hide system bar for tablet device. I searched a lot but not succeed. I added image for it.

I found some solution like

View v = findViewById(R.id.view_id);
v.setSystemUiVisibility(View.STATUS_BAR_HIDDEN); 

but I dont know how to use it enter image description here

And I know that is possible as http://forum.xda-developers.com/showthread.php?t=1228046 Can any one know how to do this ?

like image 702
Chirag Patel Avatar asked Aug 14 '12 17:08

Chirag Patel


2 Answers

Code snippet to show/hide status bar on rooted android tablets

To hide:


            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 (Exception e) {
                Log.w("Main","Failed to kill task bar (1).");
                e.printStackTrace();
            }
            try {
                proc.waitFor();
            } catch (Exception e) {
                Log.w("Main","Failed to kill task bar (2).");
                e.printStackTrace();
            }

To show:


            Process proc = null;
            try {
                proc = Runtime.getRuntime().exec(new String[] { "su", "-c", "am startservice -n com.android.systemui/.SystemUIService" });
            } catch (Exception e) {
                Log.w("Main","Failed to kill task bar (1).");
                e.printStackTrace();
            }
            try {
                proc.waitFor();
            } catch (Exception e) {
                Log.w("Main","Failed to kill task bar (2).");
                e.printStackTrace();
            }
like image 116
Basher51 Avatar answered Oct 09 '22 05:10

Basher51


Finally after searching lots of time I got some alternativ for my requirement.

I know this is not a good idea for a programmer to back off from this situation but for my time limit I used this way...

I found this link and application which fullfil my requirement

http://www.42gears.com/blog/2012/04/how-to-hide-bottom-bar-in-rooted-android-3-0-tablets-using-surelock/

please visit this once if you want this type of requirement in your application ....

Thanks to all for helping me in my problem...

like image 43
Chirag Patel Avatar answered Oct 09 '22 06:10

Chirag Patel