> I made an example that sleeps inside the Runnable. The entire WebView
> becomes unresponsive! What is the proper way (if any) of implementing
> a long-running JavaScript call?

Everything is fine except for sleeping in the Runnable. The Runnable is
run on the UI thread -- sleeping on the UI thread, like sleeping on the
job, is not a good idea.

If you want something that will run for a long time, use a background
thread, perhaps in the form of an AsyncTask.

>
> Is it safe to call loadUrl() from multiple threads?

I have not tried it, but I doubt it. If you use AsyncTask, do your
loadUrl() in onPostExecute().

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to