title: Block status bar in all applications
body: <p>I need to block status bar in all applications. I know it is possible becouse it was done in SureLock. I can do that in my activity with this:</p>
  
  <pre><code>@Override
  public void onWindowFocusChanged(boolean hasFocus)
  {
      try
      {
          if(!hasFocus)
          {
              Object service  = getSystemService("statusbar");
              Class&lt;?&gt; statusbarManager = Class.forName("android.app.StatusBarManager");
              Method collapse = statusbarManager.getMethod("collapse");
              collapse .setAccessible(true);
              collapse .invoke(service);
          }
      }
      catch(Exception ex)
      {
          if(!hasFocus)
          {
              try {
                  Object service  = getSystemService("statusbar");
                  Class&lt;?&gt; statusbarManager = Class.forName("android.app.StatusBarManager");
                  Method collapse = statusbarManager.getMethod("collapse");
                  collapse .setAccessible(true);
                  collapse .invoke(service);
  
              } catch (Exception e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();                
              }
              ex.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>But how do that in all apps like in <a href="https://play.google.com/store/apps/details?id=com.gears42.surelock" rel="nofollow">SureLock</a>?</p>