Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8201383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:47:38+00:00 2026-06-07T06:47:38+00:00

I´m drawing a route in the MapActivity using the code: ArrayList<Routemark> route_marks = navSet.getRoutemarks();

  • 0

I´m drawing a route in the MapActivity using the code:

ArrayList<Routemark> route_marks = navSet.getRoutemarks();

    for(int i = 2; i < route_marks.size() - 1; i++)
    {
        try
        {

            DirectionPathOverlay dpo = new DirectionPathOverlay(point1, point2);    
            mMapView01.getOverlays().add(dpo);

                point1 = point2;
            lon_d = Double.parseDouble(route_marks.get(i).getLongitude()) * 1E6;
            lon = (int)lon_d;
            lat_d = Double.parseDouble(route_marks.get(i).getLatitude()) * 1E6;
            lat = (int)lat_d;
            point2 = new GeoPoint(lat, lon);
            list_points.add(point2);

        }
        catch(Exception e) {
          }


    }
    mMapView01.getOverlays().add(new DirectionPathOverlay(point2, point2));

And

public class DirectionPathOverlay extends Overlay {

private GeoPoint gp1;
private GeoPoint gp2;

public DirectionPathOverlay(GeoPoint gp1, GeoPoint gp2) {
    this.gp1 = gp1;
    this.gp2 = gp2;
}

@Override
public boolean draw(Canvas canvas, MapView mapView, boolean shadow,
        long when) {
    // TODO Auto-generated method stub
    Projection projection = mapView.getProjection();
    if (shadow == false) {

        Paint paint = new Paint();
        paint.setAntiAlias(true);
        Point point = new Point();
        projection.toPixels(gp1, point);
        paint.setColor(Color.BLUE);
        Point point2 = new Point();
        projection.toPixels(gp2, point2);
        paint.setStrokeWidth(2);
        canvas.drawLine((float) point.x, (float) point.y, (float) point2.x,
                (float) point2.y, paint);
    }
    return super.draw(canvas, mapView, shadow, when);
}

@Override
public void draw(Canvas canvas, MapView mapView, boolean shadow) {
    // TODO Auto-generated method stub

    super.draw(canvas, mapView, shadow);
}

}

I´m executing the code into new thread and I´m getting the exeption:

    07-08 18:23:21.179: E/AndroidRuntime(23510): FATAL EXCEPTION: main
07-08 18:23:21.179: E/AndroidRuntime(23510): java.util.ConcurrentModificationException
07-08 18:23:21.179: E/AndroidRuntime(23510):    at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:569)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:44)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at com.google.android.maps.MapView.onDraw(MapView.java:530)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at android.view.View.draw(View.java:11082)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at android.view.ViewGroup.drawChild(ViewGroup.java:2991)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at android.view.ViewGroup.drawChild(ViewGroup.java:2989)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at android.view.ViewGroup.drawChild(ViewGroup.java:2989)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at android.view.ViewGroup.drawChild(ViewGroup.java:2989)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at android.view.View.draw(View.java:11085)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at android.widget.FrameLayout.draw(FrameLayout.java:462)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2145)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at android.view.ViewRootImpl.draw(ViewRootImpl.java:2026)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1634)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at android.os.Handler.dispatchMessage(Handler.java:99)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at android.os.Looper.loop(Looper.java:137)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at android.app.ActivityThread.main(ActivityThread.java:4441)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at java.lang.reflect.Method.invokeNative(Native Method)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at java.lang.reflect.Method.invoke(Method.java:511)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
07-08 18:23:21.179: E/AndroidRuntime(23510):    at dalvik.system.NativeStart.main(Native Method)

Where is the problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T06:47:40+00:00Added an answer on June 7, 2026 at 6:47 am

    ConcurrentModificationException is usually thrown when you’re trying to modify a List while traversing through it. If you need to implement this kind of functionality, you should go with CopyOnWriteArrayList rather then a simple ArrayList. Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following drawing code: [[NSColor redColor] set]; NSRect fillRect = NSMakeRect(bounds.size.width -
When i am using below url for drawing route on map on android: StringBuilder
I'm using route-me in my project. Library is quite good. Adding markers, drawing polygone
I'm using the code below to get the route between two points: directionsService.route(request, function(response,
We are developing an drawing application for iOS and android. I am using cubic
Drawing more than ~5+ SVG lines with the code below makes performance choppy when
I'm drawing rectangles on the screen using the basic NSBezierPath method. I have an
When drawing an editable Polygon on a map using Google's V3 API, is there
On drawing on canvas if i use this code to draw the bitmap then
I am currently drawing a Bitmap to a SurfaceView using Canvas.drawBitmap() . This seems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.