1

I have a webview, and I am loading a webpage in it where I do call a JS interface function implemented in native app, in document.ready. And I also handle WebChromeClient.onProgressChanged, and do some operations when the progress reaches 100%.

What I do find is that onProgressChanged reaches 100% first, and there is a few seconds delay before the JS interface handler called in document.ready is invoked. The webpage being loaded is small, and has no resources at all. This behavior shows up as unacceptable user experience. Why is there such a delay, and what is the right Webchromeclient callback/Jquery method to use to minimize this delay?

Gunanaresh
  • 959
  • 1
  • 9
  • 20
  • because a page is loaded before the script are triggered, document ready looks for all html elements to be loaded first except images and things like that, so your script does not fire until everything has been loaded, by that time your onprogresschanged has received 100% first as it may be have a higher priority than your javascript after all devices do ask to check if js should be allowed or not so it has to go through some checks before this method is called :) – Val Jun 27 '11 at 14:26

0 Answers0