Android WebViewClient problem

Posted by deSelby on Stack Overflow See other posts from Stack Overflow or by deSelby
Published on 2010-06-09T20:35:51Z Indexed on 2010/06/09 20:42 UTC
Read the original article Hit count: 303

Filed under:

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());).

The class definition is as follows:

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;
    }
}

My problem is that onPageFinished is definitely getting called, but shouldOverrideUrlLoading is never being called.

What am I doing wrong here?

© Stack Overflow or respective owner

Related posts about android