This is right because look at the decleartion: OverlayItem overlayItem
and List<OverlayItem> arrItem[]
.
So if you arrItem[] = overlayItem
you implicit claim List<OverlayItem> = OverlayItem
. :)
(I'm not sure but I think it's even "worse" with the []
at the end of variable's name. I think the brackets are reserved for arrays thus List<OverlayItem> arrItem[]
results in an Array of Lists o.O)
You want to create a new List of OverlayItems and thenn add the item to this list. I'm not sure if you can instantiate List
directly so I use ArrayList
:
GeoPoint point = new GeoPoint((int)(Double.parseDouble(arrCoordonate[1])),(int)(Double.parseDouble(arrCoordonate[0])));
OverlayItem overlayItem = new OverlayItem(point, Double.parseDouble(arrCoordonate[1]) + "", Double.parseDouble(arrCoordonate[0]) +"");
ArrayList<OverlayItem> arrItem = new ArrayList<OverlayItem>();
arrItem.add(overlayItem);