title: How to launch a web link from within my WebView in a registered app on Android?
body: <p>In my android app, I have a WebView. I want <strong>every</strong> link click within my WebView to launch the registered app on my device, if any, otherwise open in an external browser. For example, if a user clicks on a Facebook page link from within the WebView, it should launch the Facebook app (if facebook is registered on the device to handle facebook links). If no app is registered, it should launch the external browser (i.e, it should not load the page in the same WebView).</p>
  
  <p>Currently (by default), the WebView just loads any link clicked within the WebView within itself.</p>
  
  <p>I realize I need to override shouldOverrideUrlLoading to intercept those link clicks:</p>
  
  <pre><code>webView.setWebViewClient(new WebViewClient() {
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
          // what should go here to trigger the registered app or fall back to external browser for all link clicks in the WebView?
      }
  }); 
  </code></pre>
  
  <p>I also looked at intent filters, but that seems to be the inverse of this requirement (intent filters seem to be a way for me to register <strong>my</strong> android app to handle web clicks elsewhere). </p>
  
  <p><strong>Update 1</strong>: </p>
  
  <p>I am <em>not</em> looking to intercept any particular host name or scheme - I want <em>every</em> link that is clicked in my web view to be 'delegated' to android, where android decides whether to launch a registered app, pop up a choice for user to pick which app to open in, or open in web browser, depending on user settings.</p>
  
  <p>Specifically, if I click on a link to <a href="https://www.facebook.com/blah" rel="noreferrer">https://www.facebook.com/blah</a> it should launch in the facebook app and take me to the blah page there. </p>