IllegalMonitorStateException on 'object.wait()' call randomly

by svd » Fri, 23 Apr 2010 08:04:51 GMT


Sponsored Links
 My code throws an IllegalMonitorStateException on 'object.wait()'
call, even though wait is invoked inside a synchronized block. And
this exception occurs only randomly not always.

below is my code snippet:

while (!mFinish) {
          synchronized (mResponse) {
                    if (!mResponse.isEmpty()) {
                           do something
                    } else {
                        try {
                            mResponse.wait(1000);
                        } catch (InterruptedException ie) {
                           ......
                        }
                    }

          }
}

Also all the 'notify' methods are in synchronized block.
Please point out if there is anything wrong in my code?

--



Other Threads

1. Pick a zoom to fit all map overlays on screen?

Hi,

I've added a few pin overlays to a MapView. Is there a way to have the
MapView center and zoom itself so it automatically fits all overlays
on-screen?

I'm following the hello world map sample exactly - just need a way to
make sure all pins are on screen when the map actually gets displayed:
http://developer.android.com/guide/tutorials/views/hello-mapview.html

Thanks

--~--~---------~--~----~------------~-------~--~----~

2. 1.6 Camera rotation issue.

My app while compiled in 1.5 works fine. I had some memory issues w/
1.6 due to image size, which was strange b/c the image size increased
when taking photos by taking a picture w/ surfaceholder/imagecapture
callback. I seem to have fixed re-displaying those images by resizing
them using a bitmapfactory matrix. But my camera is now rotating
everything 90 degrees. It appears that my Override of surfaceChanged
does nothing, which is where I was setting rotation at 90 (I can't
remember why, it was 10 months ago!). I have tried at rotating the
camera parameters paramters at 90 degrees, 0 degrees. It does not seem
to do anything... any thoughts?

Chris.
--~--~---------~--~----~------------~-------~--~----~

3. Two questions.

4. Programming The UI

5. Reg. Updgrade System App from Android Market

6. Android browser cannot automatically submit forms

7. Messaging: Multiple Thread Delete