title: WebViewClient not calling shouldOverrideUrlLoading
body: <p>The problem is rather simple. 
  In the application we want to keep track of the current url being displayed. For that we use <code>shouldOverrideUrlLoading</code> callback from the <code>WebViewClient</code> by saving the url into a class field for every update. Here is the relevant code:</p>
  
  <pre><code>    mWebView.getSettings().setJavaScriptEnabled(true);
      mWebView.getSettings().setDomStorageEnabled(true); 
      mWebView.setWebViewClient(new WebViewClient() {
          @Override
          public boolean shouldOverrideUrlLoading(WebView view, String url) {
              mCurrentUrl = url;
  
              // If we don't return false then any redirect (like redirecting to the mobile
              // version of the page) or any link click will open the web browser (like an
              // implicit intent).
              return false;
          }
  
  
  
          @Override
          public void onPageFinished(WebView view, String url) {
              super.onPageFinished(view, url);
              ...
          }
      });
      mWebView.loadUrl(mInitialUrl);
  </code></pre>
  
  <p>However, there is at least one scenario, where the callback never gets triggered and the mCurrentUrl field doesnt get updated.</p>
  
  <p>The url: <a href="https://m.pandora.net/es-es/products/bracelets/556000">https://m.pandora.net/es-es/products/bracelets/556000</a></p>
  
  <p>Last updated url (shouldOverrideUrlLoading never gets called when clicking the product): <a href="https://m.pandora.net/es-es/products/bracelets">https://m.pandora.net/es-es/products/bracelets</a></p>
  
  <p>I have tried with callbacks like onPageStarted(), but the url also gets filtered and there doesn't seem to be an accessible one upstream since its protected code.</p>
  
  <p>Reading android documentation about WebView I found this:</p>
  
  <p><a href="https://developer.android.com/guide/webapps/migrating.html#URLs">https://developer.android.com/guide/webapps/migrating.html#URLs</a></p>
  
  <p><em>The new WebView applies additional restrictions when requesting resources and resolving links that use a custom URL scheme. For example, if you implement callbacks such as shouldOverrideUrlLoading() or shouldInterceptRequest(), then WebView invokes them only for valid URLs.</em></p>
  
  <p>But still doesnt make sense since the above url is generic and should meet the standard. </p>
  
  <p>Any alternative or solution to this?</p>