Android WebViewClient problem
- by deSelby
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?