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 3937400
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:03:51+00:00 2026-05-20T00:03:51+00:00

I have a task to show 458 markers to show in Android maps. And

  • 0

I have a task to show 458 markers to show in Android maps. And to avoid performance related issues I update the data on map using an AsyncTask instance.

Here is a short scenario of what I do.

  1. I fetch the latitude/longitude of 458 locations around UK.
  2. I run the loop and as per Android Blog tutorial I add them in ItemizedOverlay class
  3. After every 50th iteration I call publishProgress method to place 50 markers in map.

After the 50th iteration the flow goes into onProgressUpdate via publishProgress and here is my code of onProgressUpdate method

// MapOverLays = mapView.getOverlays(); 
//This line was called in asyc task's constructor   
// Hello Overlay is an instance of ItemizedOverlay.
mapOverlays.add(helloOverLay);
//MapView.getController - Also called in Constructor
controller.setZoom(12);

controller.animateTo(centerPoint);
controller.setCenter(centerPoint);

This code throws ArrayIndexOutOfBoundException and the logcat doesn’t show any of the class from my module. Here is the logcat dump if it elaborates my problem.

12-07 11:34:48.644: ERROR/AndroidRuntime(508): java.lang.ArrayIndexOutOfBoundsException
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at com.google.android.maps.ItemizedOverlay.getIndexToDraw(ItemizedOverlay.java:211)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at com.google.android.maps.ItemizedOverlay.draw(ItemizedOverlay.java:240)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at com.google.android.maps.Overlay.draw(Overlay.java:179)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:42)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at com.google.android.maps.MapView.onDraw(MapView.java:476)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.View.draw(View.java:6535)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewGroup.drawChild(ViewGroup.java:1531)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewGroup.drawChild(ViewGroup.java:1529)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.View.draw(View.java:6538)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewGroup.drawChild(ViewGroup.java:1531)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewGroup.drawChild(ViewGroup.java:1529)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.View.draw(View.java:6538)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1830)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewRoot.draw(ViewRoot.java:1349)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1114)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.os.Handler.dispatchMessage(Handler.java:99)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.os.Looper.loop(Looper.java:123)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at android.app.ActivityThread.main(ActivityThread.java:4363)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at java.lang.reflect.Method.invokeNative(Native Method)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at java.lang.reflect.Method.invoke(Method.java:521)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
12-07 11:34:48.644: ERROR/AndroidRuntime(508):     at dalvik.system.NativeStart.main(Native Method)

P.S. I have tested the application with relatively smaller (10) and relatively larger (150) iterations instead of 50. But the application throws same Error.

  • 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-05-20T00:03:52+00:00Added an answer on May 20, 2026 at 12:03 am

    I have temporarily get the solution. Instead of adding pins frequently i first prepare whole data and than add it in map using onPostExecute() as described Android 2.1 GoogleMaps ItemizedOverlay ConcurrentModificationException but it still doesn’t meet my requirement to save the time to load all pins. However i can get rid of that exception. But waiting for any suggestions that improve the loading time…. Thanks anyway… 🙂

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

Sidebar

Related Questions

I have a task to show digital clock (with minutes precision) on HTML page
I have a background worker running a long database task. i want to show
I have a task and I want to generate some code using the CodeDom.
I have this task for the project with 4 nested subprojects using Maven: For
i have long running task that gets called using jquery ajax. i am using
I'm using UISplitViewController for app on iPad. The first task was to show master
I have the unfortunate task of having to import data from excel into a
i have a javascript function who's task is to show the hidden rows of
I have a task to show to the site admin a list of user
I have a task to develop the application with map kit and web service

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.