How to set a callback when WebView provided data (ready to display)

I use WebView in a dialog box and on first start it takes up to 1 second to display very simple content. The content is installed from the code as a string (without downloading from the network). At the beginning, for a while I see an empty dialog, and then the contents appear. How to set a callback at the moment when WebView is ready to display, and then call show on AlertDialogBuilder? I tried WebViewClient.onPageFinished, WebViewClient.PictureListener.onNewPicture, WebChromeClient.onProgressChanged (== 100) with no effect.

+5
source share
1 answer
webViewInstance.setPictureListener(new PictureListener() {      
   @Override
   public void onNewPicture(WebView view, Picture picture) {
      // the code goes here
   }
});
+1
source

All Articles