Hello everybody,
I know there are some problems with memory and bitmaps concerning the overlay.
When my MapActivity is hidden by another Activity and then shown again I get an OutOfMemory exception as shown:
Bitmap.createBitmap(int, int, Bitmap$Config) line: 468
PlaceOverlay(Overlay).changeSize() line: 409
PlaceOverlay(Overlay).run() line: 246
06-26 18:37:10.671: E/GraphicsJNI(4762): VM won't let us allocate 582400 bytes
where "PlaceOverlay" is a simple class extending "Overlay" and doing some painting in "drawOverlayBitmap".
Now I wonder whether 500kByte a reasonable size for a bitmap which is allocated for an overlay, or am I doing something wrong here? I also wonder why the changeSize() is called.
Is there a work around, like using a single overlay for doing all the work (currently I am using about 10 different overlays in my app).
I create and add the overlays in onStart() of the Activity and in onStop() I call mapView.getOverlays().clear(). Is there anything else I can do?
Fortunately this happens mostly while debugging but i am not sure about crashes when running without debugging.
Best regards and thank you for the excelent work,
Gerhard