Saturday, June 5, 2010

[android-developers] Calling wait in AsyncTask (e.g. inside doInBackground) raises IllegalMonitorStateException

Hi,

I have two AsyncTasks running; let's say A1 and A2. A2 is manipulating
the data produced by A1 (in fact is a typical producer-consumer
scenario). It's very tempting to use wait() inside doInBackground()
implementation of A2, BUT this causes an IllegalMonitorStateException.
Is it really not possible to "wait()" inside an AsyncTask? What to do
when you have an AsyncTask which needs to wait for something?

Thank you in advance,

-Ali

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment