Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid WebViewClient problem
    text
    copied!<p>I've defined a private class that extends WebViewClient and set my WebView's client to an instance of that class (webView01.setWebViewClient(new Callback());).</p> <p>The class definition is as follows:</p> <pre><code>private class Callback extends WebViewClient { public void onLoadResource (WebView view, String url) { } public void onPageStarted (WebView view, String url, Bitmap favicon) { } public void onPageFinished (WebView view, String url) { Animation anim = AnimationUtils.loadAnimation(MyNews.this, R.anim.webviewanim); view.startAnimation(anim); } public void onReceivedError (WebView view, int errorCode, String description, String failingUrl) { } public boolean shouldOverrideUrlLoading (WebView view, String url) { Log.e("loading url", url); return false; } } </code></pre> <p>My problem is that onPageFinished is definitely getting called, but shouldOverrideUrlLoading is never being called.</p> <p>What am I doing wrong here?</p> <p>6/13/2010</p> <p>A little more information. </p> <p>I'm loading the initial page from a string ( webView01.loadDataWithBaseURL("fake://fake", myHTML, "text/html", "UTF-8", null); ).</p> <p>The page loads (and there are several calls to onLoadResource) and onPageFinished is being called at page load completion.</p> <p>When the user taps on an Anchor link in the page, instead of calling shouldOverrideUrlLoading, onLoadResource is called.</p> <p>I need to invoke the full web browser when the user taps on the link, but I never get the chance to override url loading.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload