My problem is that sometimes I've got a blank-white webview for a couple of seconds instead of rendered HTML which is quite depressing. I want to implement some kinda listener to check if webview renders all the HTML. In other words: I want to make my webview blank-white proof.
I've already inserted the javascript simple trigger in the HTML that tells app when the HTML is fully loaded and ready to render:
$(window).load(function(){
tellAndroidImReady();
});
It works perfect, but sometimes I'm getting this blank screen going for a couple of seconds instead of shiny rendered page. And this makes me crazy ...
I've made some searches on stackoverflow and found only this topic where it says that the part of the method that is used in the solution is deprecated so I guess it's not supposed to be correct.
You need
mWebView.setWebViewClient(new WebViewClient() {
public void onPageFinished(WebView view, String url) {
// your code
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With