title: Draw and hook guestures without stopping app underneith
body: <p>Im trying to figure out how apps like swipe pad (<a href="https://market.android.com/details?id=mobi.conduction.swipepad.android" rel="nofollow">https://market.android.com/details?id=mobi.conduction.swipepad.android</a>) can hook guestures regardless of what window/app is on top, and how its able to draw and interact without stopping the background apps below it.</p>
  
  <p>I have been able to create apps like dialogs and popup windows, but i cannot get them to show without stopping/freezing the background application.</p>
  
  <p>UPDATE: found a suitable solution.</p>
  
  <p>in your service's onCreate add this</p>
  
  <pre><code>WindowManager.LayoutParams params = new WindowManager.LayoutParams(
              WindowManager.LayoutParams.WRAP_CONTENT,
              WindowManager.LayoutParams.WRAP_CONTENT,
              WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,
              WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL|WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
              PixelFormat.TRANSLUCENT);
      params.setTitle("title");
      WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE);
      wm.addView(layout, params);
  </code></pre>
  
  <p>touch events are handled just like regular except when you dont touch an element of the services gui, then the service doesnt read the touch and its dropped through to the underlying program</p>