title: How to prevent Activity underneath DialogActivity from getting TouchEvents on dismissal of DialogActivity?
body: <p>Does anyone know how to prevent a touchevent from reaching the <code>Activity</code> underneath a <code>DialogActivity</code>?</p>
  
  <p>I'm using the following code that allows the user to dismiss the DialogActivity when it is touched outside its bounds:</p>
  
  <pre><code>setContentView(R.layout.dialog_activity_options);
  this.setFinishOnTouchOutside(true);
  </code></pre>
  
  <p>However, if the <code>DialogActivity</code> (the green area) is showing above a clickable region sitting within the <code>Activity</code> below as demonstrated in the mockup below (the blue area) and you click outside the <code>DialogActivity</code> in order to dismiss it, the touchevent actually dismisses the <code>DialogActivity</code> <strong>AND</strong> results in the clickable region from being clicked. In my case, this caused the <code>DialogActivity</code> to be dismissed and a new <code>activity</code> to be started as the "blue area" started a  new activity through an intent.</p>
  
  <p>How do I just get the <code>DialogActivity</code> to dismiss <strong>without</strong> passing the touchevent onto the <code>Activity</code>?</p>
  
  <p><a href="https://i.stack.imgur.com/ZCLbj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZCLbj.png" alt="enter image description here"></a></p>