Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 2
    You code looks good. I have been trying the same for my webview which loads from html data not url. But this one triggers the onPageFinished if the first webview loads quickly and before the second one starts to load. Normal scenario. running =1 , running = 2, --running =1 , --running =0. Unusual scenario that fails - running =1 , --running = 0, running =1 running =0 Commented Mar 19, 2014 at 7:04
  • 1
    There is also another scenario, when an event is not fired for some reason the TODO part will be never be reached. So you need a timer to check for timeouts. Or you can call an exported java function in javascript when you know everything is loaded properly. Something like documentReady() or something like that. Commented Jun 14, 2015 at 8:19
  • why not just running = 1; in onPageStarted() ? Commented Jul 14, 2016 at 7:29
  • @Choletski Because the maximum of 1 and a number larger than 1 is not 1. Commented Mar 18, 2018 at 9:04