To hide the notification panel, use the following code:
WindowManager.LayoutParams attrs = act.getWindow().getAttributes(); attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN; act.getWindow().setAttributes(attrs);
To display the notification panel, use the following code:
WindowManager.LayoutParams attrs = act.getWindow().getAttributes(); attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN; act.getWindow().setAttributes(attrs);
You probably want to call the code in Activity.onCreate ().
source share