OverlayItem ArrayIndexout of bounds

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

OverlayItem ArrayIndexout of bounds

Postby vik » Thu Oct 01, 2009 9:07 am

hey guys i want to add more than 300 overlay items through threading n i could not find a way to do that.. means whenever i try to create more than 50 threads (Threads task is to just add overlay item n populate) i get an exception arrayindex out of bounds....

can any1 help me out with this...

my addoverlay method follow
public void addOverlay(OverlayItem overlay, int i )
{

mOverlays.add(overlay);
populate();
}

and thread cotains following code

class showLocationSet implements Runnable
{
private MapOverlay itemizedOverlay;
private int ctr = 0;
showLocationSet(MapOverlay ItemizedOverlay, int Ctr )
{
itemizedOverlay = ItemizedOverlay;
ctr = Ctr ;
}
public void run()
{

Log.i("itemoverlay" , "" + ctr);
itemizedOverlay.addOverlay(itemizedOverlayArr[ctr], ctr);

}

}


this thread is called 50 times ... i wanna call it 300 times thats it ...
bt arrayindex out of bound!!!!!!!!
User avatar
vik
Senior Developer
Senior Developer
 
Posts: 141
Joined: Wed Sep 09, 2009 7:32 am

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 5 guests