I'm loading a url into a webview and accessing the "onPageFinished" method to hide the loading spinner. However, this seems to block all phone number links and street address links from clicking through. They will appear as links but nothing happens when clicking them.
If I comment out the "mWebView.setWebViewClient ..." area below, then phone number links will bring up the dialer and street addresses will be mapped on Google Maps, but the spinner keeps on spinning in the title bar after the page loads.
Any ideas? thanks!
The xml:
<?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
And the java:
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
Map <String, String> headerAuth = new HashMap <String, String>();
headerAuth.put("Authorization", "Basic " + encodedString);
String url = "URL to my web page";
mWebView.setWebViewClient(new WebViewClient() {
public void onPageFinished(WebView mWebView, String url) {
g_progressBar.setVisibility(View.INVISIBLE);
}
}); // commenting this out fixes problem, but I need it to remove loading indicator in title bar
mWebView.loadUrl(url, headerAuth);