in one of my app i am using webview to load the pages, the scenario is i have Activity A and Activity B, Activity A displays the menu list, on selection of any of the item in the list it will open Activity B, in Activity B I am doing all the webview related activities like loading webview using the URL but its taking lot of time to display that page, my question here is there anyway i can preload the webview in activity A and pass it to B for immediate loading.
if it's possible to preload the webview in Activity A and pass it to Activity B for immediate rendering please let me know how it is doable?
Note : I can use progress dialog in Activity A until the webview loads(wait till onPageFinished) get called and start the Activity B, but how can i make the webview load immediately here?
You cant share of transfer views between activities in any way. So you should stay within single activity (you can use fragments to organize your views). Create webview, hide it, start loading data. Show webview when data is loaded.
P.S. You can manually download html source code and/or some resources to use with webview later... but this can be tricky.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With