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. Simultaneously debugging multiple android applications and components

Hi,
       I need to be able to simultaneously debug multiple components
from the android-2.2.1 repo, in order to troubleshoot a wifi restart
issue that I'm facing that is being discussed on the following thread:

2. Android Library project and widget xml referes in AndroidManifest.xml

Hello,
i'm using Android Project Library (http://goo.gl/7vvxI). In Android
docs, it copys all items from android library project
AndroidManifest.xml in application AndroidManifest.xml

like in example, AndroidManifest.xml of library project
<manifest>
  ...
  <application>
    ...
    <activity android:name="GameActivity" />
    ...
  </application>
  ...
</manifest>

so, AndroidManifest.xml of application must be
<manifest>
  ...
  <application>
    ...
    <activity
android:name="com.example.android.tictactoe.library.GameActivity" />
    ...
  </application>
  ...
</manifest>

So, if in library project i've a widget declaration, like below, how i
can refer to widget xml in application AndroidManifest.xml?

In library project

<receiver
android:name="com.example.android.tictactoe.library.MedWidget"
android:label="@string/label_med_widget">
        <meta-data android:name="android.appwidget.provider"
android:resource="@xml/med_provider" />
        <intent-filter>
          <action
android:name="android.appwidget.action.APPWIDGET_UPDATE" />
        </intent-filter>
      </receiver>

in meta-data i refer to med_provider in xml folder. Do i need to copy
med_provider.xml in xml folder of application?

thanks.

-- 

3. Hoe does EntityDelta perform RawContact aggregations?

4. Import Contacts from .vcf file in Android 2.1

5. Spica

6. (WTA) : Market Enabler + Galaxy 550

7. Isilo