title: How to overlay status bar and navigation bar from a Service? (android 4.4)
body: <p><strong>android 4.4</strong></p>
  
  <p>I have a Service which is launched by Application (NOT an Activity).
  When required, the Service needs to overlay the taskbar and navigation bar with a view.
  How do I do it?
  I tried</p>
  
  <pre><code> &lt;uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /&gt;
  
  WindowManager.LayoutParams params = new WindowManager.LayoutParams(
     WindowManager.LayoutParams.WRAP_CONTENT,
     WindowManager.LayoutParams.WRAP_CONTENT,
     WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,
     WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
     PixelFormat.OPAQUE);
  
  rootView = // inflate layout from xml file
  WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
  wm.addView(rootView, params);
  </code></pre>
  
  <p>This goes <strong>behind</strong> the taskbar and does not overlay it.</p>
  
  <p>The android documentation <a href="https://developer.android.com/training/system-ui/navigation.html" rel="nofollow">https://developer.android.com/training/system-ui/navigation.html</a>
  requires using a DecorView obtained from getWindow().
  My code will not compile since getWindow() does not exist.
  How to overlay status bar and navigation bar from a Service? (android 4.4)                 </p>