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. Back Button displays previous activity

hi guys,

i have many activities in my application. since i had this issue
previously too, after going through few replies related to this issue
i used to start my activities like this

startActivityForResult(intent, 107);

so when i'm done with the started activity i'm calling finish() as
well as finishActivity(107)

now i have 1 activity which will display a List and another activity
to have a Blur background.

since underneath of the blur activity i have to display List activity
once i'm done with the list i'm not calling finish() or
finishActivity(107)

so once i pressed back button i'm calling finishActivity(107) but
still it displays the List activity.

may i know why is that and could you guys tell me how to achieve
this??


regards,
mike

-- 

2. Update SOLD WTS Nexus One 2nd Mulus Lengkap Mint Condition

Sudah sold ke rekan di Depok :p







-- 
feel free to message me

WhORty lackBerryMaLang
Upgrade,Install,Training and Acessories
ym dan email : who...@yahoo.com

sent by nyxBerry9700 - 5.0.0.423

-- 
"Indonesian Android Community [id-android]" 

3. centering a canvas in a view

4. Mohon Review Samsung Galaxy Spica

5. Persistent Android Activities

6. How to detect application launch and shutdown events?

7. Re[2]: There are no secret APIs