I have a webview and an string that holds over 500kb which displays the page. Does anyone have any idea to decrease the loading time of a webview?. The way I load is synchronous would it be better if I load it asynchronous. Any help is greatly appreciated.
Share
If you would like to increase the loading time of your web view while other views load normally you should
Thread.sleep(<time you want to wait>)in it set at how long you would like to wait, then executeloadData(<data>)executeon your async tasks and it will perform the sleep then load in the background while other views are being populated.Is that really what you want to do?
UPDATED
You can’t decrease the time it takes to load the web view by loading it asynchronous but you can stop it from blocking other views from loading while it loads.
If the page makes sense (doesn’t look a mess) without the web view then you can load it on a separate thread (
AsyncTaskor creating a runnable class and callingrunOnUiThread()) task with that view being updated when it is ready. An option would be to load from a thread and make the thread low priority so it would most likely wait for views to be rendered and then start the heavy html processing.You could also look at splitting the html up into separate views, embedding the dynamic content in standard android views or launching the browser activity and displaying it there