title: What is the preferred method of getting variable values in an ItemizedOverlay's draw method?
body: <p>Using an ArrayList of GeoPoints, I'm looking to draw points on a map and connect them with a line.  I've got the "point" part working, but not the lines.  My ItemizedOverlay class:</p>
  
  <pre><code>private class myItemizedOverlay extends ItemizedOverlay&lt;OverlayItem&gt;
  {
      private ArrayList&lt;OverlayItem&gt; items = new ArrayList&lt;OverlayItem&gt;();
      private ArrayList&lt;GeoPoint&gt; geoPoints = new ArrayList&lt;GeoPoint&gt;();
      private int color;
  
      public myItemizedOverlay (Drawable marker, ArrayList&lt;GeoPoint&gt; gp, int c)
      {
          super(marker);
          geoPoints = gp;
          color = c;
  
          boundCenter(marker);
  
          for (int i = 0; i &lt; geoPoints.size() - 1; i++)
          {
              items.add(new OverlayItem(geoPoints.get(i)));
          }
  
          populate();
      }
  
      @Override
      protected OverlayItem createItem(int i)
      {
          return items.get(i);
      }
  
      @Override
      public void draw(Canvas canvas, MapView mapView, boolean shadow)
      {
          super.draw(canvas, mapView, false);
  
          Paint paint = new Paint();
          paint.setColor(color);
          paint.setDither(true);
          paint.setAntiAlias(true);
          paint.setStyle(Paint.Style.FILL_AND_STROKE);
          paint.setStrokeJoin(Paint.Join.ROUND);
          paint.setStrokeCap(Paint.Cap.ROUND);
          paint.setStrokeWidth(2);
  
          Point p1 = new Point();
          Point p2 = new Point();
  
          for (int i = 1; i &lt; geoPoints.size() - 1; i++)
          {
              mapView.getProjection().toPixels(geoPoints.get(i), p1);
              int x1 = p1.x;
              int y1 = p1.y;
  
              mapView.getProjection().toPixels(geoPoints.get(i - 1), p2);
              int x2 = p2.x;
              int y2 = p2.y;
  
              canvas.drawLine(x1, y1, x2, y2, paint);
          }
      }
  
      @Override
      public int size()
      {
          return items.size();
      }
  }
  </code></pre>
  
  <p>called with:</p>
  
  <pre><code>myItemizedOverlay mo = new myItemizedOverlay(marker, geoPoints, color);
  mapView.getOverlays().add(mo);
  </code></pre>
  
  <p>I'm finding that "geoPoints" is empty in the overridden "draw" method, and I can't figure out why.  Even more confusing is that "color" is /not/ empty, and both "color" and "geoPoints" are assigned the same way.  Can anybody recommend a solution?</p>