Advertisement
Guest User

Untitled

a guest
Feb 13th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. public static void hideNavigationBar() {
  2.         try {
  3.             Process proc = null;
  4.             String ProcID = "79"; // HONEYCOMB AND OLDER
  5.             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH)
  6.                 ProcID = "42"; // ICS AND NEWER
  7.             proc = Runtime.getRuntime().exec(
  8.                     new String[] { "su", "-c", "service call activity " + ProcID + " s16 com.android.systemui" });
  9.             proc.waitFor();
  10.         } catch (Exception e) {
  11.             e.printStackTrace();
  12.         }
  13.     }
  14.  
  15.     public static void showNavigationBar() {
  16.         Process proc = null;
  17.         try {
  18.             proc = Runtime.getRuntime().exec(new String[] { "su", "-c", "am startservice -n com.android.systemui/.SystemUIService" });
  19.             proc.waitFor();
  20.         } catch (Exception e) {
  21.             // do nothing
  22.         }
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement