1

I'm using the Google maps API in my Android app, and upon instantiation I start a thread to download some images that will later become OverlayItem objects held in a customized ItemizedOverlay.

When the download finishes, the UI is notified via handler, and it removes the current overlay (if there is one), creates a new one containing the downloaded images, adds it to the the map view, and then calls the map view's invalidate() method. That leads to the customized overlay's overridden draw(canvas, mapview, shadow) method being called, and it loops through the list of items in the overlay and draws each one via canvas.drawBitmap(bitmap, left, top, paint).

All this works fine, but despite the fact that I don't touch the screen and no other invalidate() calls are done by my code, the customized overlay's draw() method gets called again and again, endlessly.

Visually this has no effect, but it is clearly undesirable. Does anybody have an idea what could cause the continuous calling of that draw() method?

Mark Peters
  • 445
  • 6
  • 10

0 Answers0