I use WebView in a dialog and at the first launch it takes up to 1 second to render very simple content. The content is set from code as a String (no loading from network). At the beginning for a while I see empty dialog and then the content appears. How to set a callback for the moment when WebView is ready to be displayed and then call show on an AlertDialogBuilder? I have tried WebViewClient.onPageFinished, WebViewClient.PictureListener.onNewPicture, WebChromeClient.onProgressChanged (==100) with no effect.
webViewInstance.setPictureListener(new PictureListener() {
@Override
public void onNewPicture(WebView view, Picture picture) {
// the code goes here
}
});
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