title: How to get link-URL in Android WebView with HitTestResult for a linked image (and not the image-URL) with Longclick
body: <p>I try to catch webview longclicks to show a context menu. (see code below)
  When longclicking an image, I always get the image-URL as extra (for a not linked image with IMAGE_TYPE and for a linked image with SRC_IMAGE_ANCHOR_TYPE).
  But how can I get the Link-URL (and not the image-URL) for an image with a hyperlink?</p>
  
  <p>Best,
  Sebastian</p>
  
  <pre><code>        mywebview.setOnLongClickListener(new OnLongClickListener() {
              public boolean onLongClick(View v) {
  
                  final WebView webview = (WebView) v;
                  final WebView.HitTestResult result = webview.getHitTestResult();
  
                  if (result.getType() == SRC_ANCHOR_TYPE) {
                      return true;
                  }
  
                  if (result.getType() == SRC_IMAGE_ANCHOR_TYPE) {
                      return true;
                  }
  
                  if (result.getType() == IMAGE_TYPE) {
                      return true;
                  }
  
                  return false;
              }
          });
  </code></pre>