title: Allow all 'market://' links from inside a webview to open Google Play store
body: <p>I have some links in my webview that are market:// links. When my users tap on them, it gives them a page cannot be found error.</p>
  
  <p>How can I allow all links that begin with market:// to automatically open the Google play store when they are tapped? I tried:</p>
  
  <pre><code>final Intent intent = new Intent("android.intent.action.VIEW");
              intent.setData(Uri.parse("market://details?id="));
              startActivity(intent);
          }
  </code></pre>
  
  <p>but that didn't seem to do anything. I am pretty new to this so any help would be appreciated. Also, FYI, I cannot change the market:// links to play.google.com myself. They are from my advertiser.</p>
  
  <p>Is there anyway I can include it in this code:</p>
  
  <pre><code>public boolean shouldOverrideUrlLoading(WebView paramWebView, String paramString) {
          if (DEBUG)
              Log.e("shouldOverride", paramString);
          if (Uri.parse(paramString).getHost()!=null &amp;&amp; (!Uri.parse(paramString).getHost().equals("market.android.com")) &amp;&amp; (!paramString.contains("facebook.com")) &amp;&amp; (!Uri.parse(paramString).getHost().contains("twitter.com")) &amp;&amp; (!Uri.parse(paramString).getHost().equals("play.google.com"))
                  &amp;&amp; (!Uri.parse(paramString).getHost().contains("bit.ly")) &amp;&amp; (!Uri.parse(paramString).getHost().contains("plus.google.com")) &amp;&amp; (!Uri.parse(paramString).getHost().contains("youtube.com"))){
              if(isAppOrGamePage(paramString)){
                  final Intent intent = new Intent(MainActivity.this, PageActivity.class);
                  intent.putExtra("app_url", paramString);
                  startActivity(intent);
              } else
                  return false;
          } else {
              final Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(paramString));
              startActivity(intent);
          }
  
          return true;
      }
  }
  </code></pre>