6

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.

Urboss
  • 1,255
  • 2
  • 10
  • 17

1 Answers1

1
webViewInstance.setPictureListener(new PictureListener() {      
   @Override
   public void onNewPicture(WebView view, Picture picture) {
      // the code goes here
   }
});
Dmitry S.
  • 8,373
  • 2
  • 39
  • 49
  • onNewPicture is [deprecated](http://stackoverflow.com/questions/8449210/what-does-this-method-is-deprecated-mean-for-application-developers). – an00b Dec 09 '11 at 18:52
  • Yeah, but is there any alternative to PictureListener in API 12> ? – lomza Nov 27 '12 at 10:15