title: FLAG_NOT_TOUCH_MODAL not working / Android
body: <p>I am developing an application on Android. My application in essence is a call log. What I want is for my application to display three buttons above all other activities when the device receives an incomming call. </p>
  
  <p>What I have right now is a <a href="http://developer.android.com/reference/android/content/BroadcastReceiver.html" rel="nofollow">BroadcastReceiver</a> which receives PHONE_STATE intents and when an incomming call is detected, an activity is started. The started activity contains the buttons I want to be displayed.</p>
  
  <p><strong>When the OverlayActivity appears, all activities underneath stop receiving touch events, that is I can touch only the OverlayActivity. How do I make them receive the events?</strong></p>
  
  <p>Right now inside my BroadCastReceiver I start the activity:</p>
  
  <pre><code>//PhonecallReceiver.java
  public void onReceive(Context context, Intent intent) {
      Intent i = new Intent(myContext, OverlayActivity.class);
      i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
      i.putExtra("phone_number", number);
      context.startActivity(i);
  }
  </code></pre>
  
  <p>The actuall activity </p>
  
  <pre><code>//OverlayActivity.java:
  protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
                  WindowManager.LayoutParams.WRAP_CONTENT,
              WindowManager.LayoutParams.WRAP_CONTENT,
              WindowManager.LayoutParams.TYPE_PHONE,
              WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | 
              WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL |
              WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,
              PixelFormat.TRANSLUCENT);
      params.gravity = Gravity.CENTER | Gravity.TOP;
      WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE);
      LayoutInflater inflater = getLayoutInflater();
      mLayout = (LinearLayout) inflater
              .inflate(R.layout.overlay_layout, null);
      wm.addView(mLayout, params);
      }
  </code></pre>