I'm working on an Android application in which I pre-load a URL to a WebView (simply with webview.loadUrl("www.google.com")). Then, at some later point, I display the WebView by adding it to a visible view. I do this so that the WebView isn't fetching information when it's being shown. it already has the website downloaded.
The problem with this is, if I load up a website that contains JavaScript, the JavaScript runs immediately (in the background) when the WebView finishes loading instead of once the WebView is shown.
I would rather the WebView just download the website, then, once it is shown, begin running the scripts contained. Any idea on how to do this?