When the page with the WebView first loads, sometimes images are missing or displayed incorrectly. If I reload the page the WebView always displays perfectly. I know everyon
Please try this instead of your way, that is a bad practice:
learnWebView.post(new Runnable() {
@Override
public void run() {
learnWebView.loadUrl("myurl");
}
});
Or this, in case the first one wont work:
learnWebView.postDelayed(new Runnable() {
@Override
public void run() {
learnWebView.loadUrl("myurl");
}
}, 500);
Hope this helps.
I met the same issue. not sure if it is the same case as yours. I spent more than 3 days and actually found the cause it that another WebView object calls pauseTimers() for saving some CPU performance which actually " Pauses all layout, parsing, and JavaScript timers for all WebViews."
Look at onViewAttachedToWindow
.
You should process your logic in javascript only after onViewAttachedToWindow
fired.