Maps and Map Overlays - ConcurrentModificationException and OutOfMemoryError

by Sripati » Thu, 02 Sep 2010 02:00:25 GMT


Sponsored Links
 i,

If i happen to be moving the map, or zooming the map when update
occurs I got the exceptions. Sometimes getting 1)
ConcurrentModificationException and sometimes getting 2)
OutOfMemoryError. Please anybody have any solution let me know. This
is very critical position.

Logcat : ConcurrentModificationException
________________________________________

09-01 10:38:38.466: ERROR/AndroidRuntime(1840):
java.util.ConcurrentModificationException
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at java.util.ArrayList
$ArrayListIterator.next(ArrayList.java:573)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:44)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
com.google.android.maps.MapView.onDraw(MapView.java:494)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.view.View.draw(View.java:6740)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.view.ViewGroup.drawChild(ViewGroup.java:1640)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.view.ViewGroup.drawChild(ViewGroup.java:1638)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.view.View.draw(View.java:6743)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.view.ViewGroup.drawChild(ViewGroup.java:1640)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.view.View.draw(View.java:6743)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.widget.FrameLayout.draw(FrameLayout.java:352)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.view.ViewGroup.drawChild(ViewGroup.java:1640)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.view.View.draw(View.java:6743)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.widget.FrameLayout.draw(FrameLayout.java:352)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.draw(PhoneWindow.java:1842)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.view.ViewRoot.draw(ViewRoot.java:1407)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.view.ViewRoot.performTraversals(ViewRoot.java:1163)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1727)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.os.Handler.dispatchMessage(Handler.java:99)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.os.Looper.loop(Looper.java:123)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
android.app.ActivityThread.main(ActivityThread.java:4627)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
java.lang.reflect.Method.invokeNative(Native Method)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
java.lang.reflect.Method.invoke(Method.java:521)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-01 10:38:38.466:



Maps and Map Overlays - ConcurrentModificationException and OutOfMemoryError

by TreKing » Thu, 02 Sep 2010 02:08:22 GMT


 





java.util.ConcurrentModificationException

09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at java.util.ArrayList

$ArrayListIterator.next(ArrayList.java:573)

09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at

com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:44)

09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at

com.google.android.maps.MapView.onDraw(MapView.java:494)

09-01 10:38:38.466: ERROR/AndroidRuntime(1840): at

android.view.View.draw(View.java:6740)


You're trying to modify the contents of an ArrayList concurrently ... don't
do that. Synchronize the access to the list. Somewhere you have a thread
that is trying to update the list at the same time the draw method is
iterating over the items.





You're running out of memory trying to create a bitmap. Looks like this is
in the bowels of the maps library and is not surprising - it's horribly
buggy. Not sure what you can do about that one. If you can reproduce the
issue reliably, submit a bug report.

-------------------------------------------------------------------------------------------------
TreKing < http://sites.google.com/site/rezmobileapps/treking> ; - Chicago
transit tracking app for Android-powered devices

--


Sponsored Links


Other Threads

1. AIDL to Connect to a server

Hi all,
      I am new to android development and I have a question about
AIDL.  I have a requirement to call some functions and perform quite a
bit of processing remote server.  Most of my calls will be made from
the ListActivity class.  Is it possible to use AIDL to call functions
on my server from the android device?  If so then is this the best way
to do this?  If not then what is the recommended way of doing this.
Thank you very much for your help, Craig

-- 

2. Post Your Business Opportunities Here

According to me sales and business increase by marketing.So market
place need to be clean and powerful.Take a step for clear business.
place ad @ http://www.adplacebd.com > your trustful partner.visit
http://www.adplacebd.com

-- 

3. Repository Grief

4. How to configure your application to ensure proper display on Motorola Droid?

5. DDMS from Eclipse doesn't send geo location to emulator.

6. openInputStream(uri) vs openFileDescriptor(uri, "r")

7. Flicker problem with animation