Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Why is OnPageFinished firing off three times for one URL load request?

$
0
0

I'm using the following code to load a webview

... webView.LoadUrl ("http://[website address here]"); ...

class MyWebViewClient : WebViewClient
{
    public override bool ShouldOverrideUrlLoading(WebView view, string url)
    {
        view.LoadUrl(url);
            Console.WriteLine("Loading web view...");
            return true;
    }

    public override void OnPageFinished(WebView view, string url)
    {
        Console.WriteLine("Finished Loading!!!");
    }

}

For some unknown reason "Finished Loading!!!" is firing off three times and is firing before the webview actually has the page loaded and visible. "Loading web view...", in contrast, is happening only once.

1) What could be causing this to happen? 2) Is there a better way to track the progress of the webview completion other than OnPageFinished?

I need to implement some sort of "Loading" spinner for the user, but until I can ensure that the webview is loaded I can't really go to this step.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>