Well I have background threads to load HTML content the way you guys describe it - I use HttpClient to grab HTML and then I use Handler to display that with WebView#loadData. But this is a special case - I want to load URL directly into the WebView#loadURL, so how do I do it on a background thread?
On Aug 4, 3:12 am, Christine <[email protected]> wrote: > I take it you don't already have a bg thread, or you wouldn't have the > problem? > > The cute way of loading data in the background is to use a service. > The simple way is to use a Handler, as Peter suggested. In the handler > task, you create a new thread that does the http stuff. If the user > needs to wait for the data to display anyway, I think you can prevent > the timeout from happening by using a progress bar. > > On Aug 4, 1:07 am, "droidin.net" <[email protected]> wrote: > > > In my app I have to load external page into WebView-based activity. > > Some of my users with slower connections are reporting screen timeout > > while waiting for the page to load. What would be a good way of > > loading the page on backgorund thread and then refreshing the screen? > > Use HttpClient to fetch it and then use WebView#loadData? My fear is - > > the page I'm loading is pretty complicated there's some JS that > > happens on load - wouldn't I just mess it up? Is there an alternative > > way of doing what I need? > > > Thanks, > > > Bo > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

