title: Android : detect click event at empty space of gridview inside linearlayout
body: <p>I have a following problem. I have a <code>GridView</code> inside <code>LinearLayout</code> as image below. I want to detect click event when user click at empty space of <code>GridView</code>, in the image, the location that I want is the red area and also inside the green area.</p>
  
  <p>But I have following problems. </p>
  
  <ol>
  <li>If I add <code>onClickListener</code> for <code>GridView</code>: error because Adapter cannot add click event.</li>
  <li>If I add <code>onItemClickListener</code> for <code>GridView</code>: I just can detect where exist items (in the image is the white box)</li>
  <li>If I add <code>onClickListener</code> for <code>LinearLayout</code> I just can detect click event on green area, not red area.</li>
  </ol>
  
  <p>So how can I fix above problem.</p>
  
  <p>@Edit: my layout looks like:</p>
  
  <pre><code>&lt;LinearLayout&gt;
    &lt;GridView
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Thanks :)</p>
  
  <p><img src="https://i.stack.imgur.com/G8NO3.png" alt="enter image description here"></p>