I am making an app where I would like the notification bar to be toggled for being show/ not being shown. Is that possible? I already know how to set button listener/override buttons but I just need the java code that makes that possible. Thanks
// Get a full-screen window
final Window win = getWindow();
win.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Be aware that:
Note that some flags must be set before the window decoration is created (by the first call to setContentView(View, android.view.ViewGroup.LayoutParams) or getDecorView()
From http://developer.android.com/reference/android/view/Window.html#setFlags(int,%20int)