title: Android WebView Long Press NOT on link i.e in White Space
body: <p>I can detect a long click on my WebView using the following code:</p>
  
  <pre><code>webView.setOnLongClickListener(new OnLongClickListener() {
          @Override
          public boolean onLongClick(View v) {
              Log.d("Debug","On Long Press Web View");
              return false;
          }
      });
  </code></pre>
  
  <p>This works fine when i long press on a link, but doesnt work when I long press in an area where no link is, i.e whitespace.</p>
  
  <p>My first thought to address this was to use the GestureDetector:</p>
  
  <pre><code>public boolean dispatchTouchEvent(MotionEvent event) {              
      super.dispatchTouchEvent(event);
      return detector.onTouchEvent(event);
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>public OnTouchListener otl = new OnTouchListener() {
      @Override
      public boolean onTouch(View v, MotionEvent event) {
          if (detector.onTouchEvent(event)){
              return true;
          }else{
              return false;
          }
      }
  };
  </code></pre>
  
  <p>And then overide the onLongPress method of the GestureDetector:</p>
  
  <pre><code>public void onLongPress(MotionEvent e) {
  
  }
  </code></pre>
  
  <p>Either of the above methods above work and the onLongPress method is executed when I long click on the web page but not on a link. The problem is when I now long click on a link both long press methods are called, firstly the GestureDetector onLongPress and secondlythe WebView onLongClick. Is there a way to just invoke only the WebView onLongClick() when i long click on a link.</p>
  
  <p>Andy</p>