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.
Asked
Active
Viewed 1,201 times
6
-
Please define "with no effect". `onPageFinished()` should be the right answer. – CommonsWare Apr 07 '11 at 17:08
-
@CommonsWare it means that it does not work for this issue. – Urboss Apr 27 '11 at 08:04
-
btw onPageFinished is triggered when page is loaded not rendered... – xpepermint Aug 23 '11 at 09:09
1 Answers
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
-