问题
I have an app which i want to open a webview
right now i am loading the webview the most simple way
i would like to load the webpage in the background so the user will not have a waiting time
maybe in a service running in the background or in a prevoius activity
i looked around the forums and could not find a refrence to the subject
help will be appriciated.
Thx
回答1:
I hade the same problem a while ago, I know what you want. Asynctask! here is a good link I read on to get it to work!
http://www.brighthub.com/mobile/google-android/articles/82805.aspx
How you get it to work properly.
Load your webview in the doInBackground and perhaps a ProgressDialog that shows that your app i working?
GL mate
回答2:
You can set the webview's visibility to GONE and load the page and when onPageFinished is fired, you can then show the webview.
Hope this helps.
回答3:
you can use asynctaskLoader take a look it's better than the asynctask because it can manage the orientation changed and some other cool things...
来源:https://stackoverflow.com/questions/7944546/android-webview-load-in-background