title: Detect click over a dialog window in Android
body: <p>I have a dialog:</p>
  
  <pre><code>final Dialog dialog = new Dialog(context);
  dialog.setContentView(R.layout.location_dialog);
  dialog.setTitle("My dialog");
  dialog.setMessage("My dialog's content");
  dialog.setCancelable(true);
  dialog.setCanceledOnTouchOutside(true);
  dialog.show();
  </code></pre>
  
  <p>I want to be able to detect touches over and outside the dialog box's lines.
  I can easily detect any touches outside the dialog box area with the build-in method</p>
  
  <pre><code>dialog.setCanceledOnTouchOutside(true);
  </code></pre>
  
  <p>But how can I detect the touches inside this area?
  <img src="https://i.stack.imgur.com/6Ocza.jpg" alt="detect touches only in the area in red."></p>