title: Android: Disable and enable to pulling the status bar programmatically for API 19
body: <p>I already done do to hide the status bar, but unfortunately I didn't found the way to display it back once its already hide. I did so many workaround but still not success, <a href="https://stackoverflow.com/a/8273225/5065755">here</a> and <a href="https://efransiscus.wordpress.com/2012/04/11/remove-android-status-bar-programmatically/" rel="nofollow noreferrer">here</a>.</p>
  
  <p><strong>Activity</strong></p>
  
  <pre><code> WindowManager manager = ((WindowManager) getApplicationContext()
                  .getSystemService(Context.WINDOW_SERVICE));
  
   WindowManager.LayoutParams localLayoutParams = new WindowManager.LayoutParams();
   localLayoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ERROR;
   localLayoutParams.gravity = Gravity.TOP;
   localLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE|
  
   // this is to enable the notification to receive touch events
   WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL |
  
   // Draws over status bar
   WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
  
   localLayoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
   localLayoutParams.height = (int) (50 * getResources()
                  .getDisplayMetrics().scaledDensity);
   localLayoutParams.format = PixelFormat.TRANSPARENT;
  
   customViewGroup view = new customViewGroup(this);
   manager.addView(view, localLayoutParams);
  </code></pre>
  
  <p><strong>customViewGroup class</strong></p>
  
  <pre><code>class customViewGroup extends ViewGroup {
  
      public customViewGroup(Context context) {
          super(context);
      }
  
      @Override
      protected void onLayout(boolean changed, int l, int t, int r, int b) {
      }
  
      @Override
      public boolean onInterceptTouchEvent(MotionEvent ev) {
          return true;
      }
  }
  </code></pre>