Android webView Load in Background

一笑奈何 提交于 2019-12-19 04:09:58

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!