title: Draw a polygon overlay on google maps in android
body: <p>I parsed a KML file and I was able to extract the longitude and latitude data from it
  The problem now is that I am trying to draw a polygon using these data in my android application but whenever I try doing so nothing changes and I get the default map that open when I run google maps.
  I have tried many codes that where given as correct answers here on stackoverflow with the same geopoints given in them also nothing appeared...Does anyone have any idea about wwhat might be the problem?
  This is the link that I tried the code in it but it is not working
  <a href="https://stackoverflow.com/questions/2176397/drawing-a-line-path-on-google-maps">Drawing a line/path on Google Maps</a></p>
  
  <p>Thanks in advance</p>
  
  <pre><code> public void draw(Canvas canvas, MapView mapv, boolean shadow){
          super.draw(canvas, mapv, shadow);
  
          Paint   mPaint = new Paint();
          mPaint.setDither(true);
          mPaint.setColor(Color.RED);
          mPaint.setStyle(Paint.Style.FILL_AND_STROKE);
          mPaint.setStrokeJoin(Paint.Join.ROUND);
          mPaint.setStrokeCap(Paint.Cap.ROUND);
          mPaint.setStrokeWidth(2);
  
          GeoPoint gP1 = new GeoPoint(19240000,-99120000);
          GeoPoint gP2 = new GeoPoint(37423157, -122085008);
  
          Point p1 = new Point();
          Point p2 = new Point();
          Path path = new Path();
  
          projection.toPixels(gP1, p1);
          projection.toPixels(gP2, p2);
  
          path.moveTo(p2.x, p2.y);
          path.lineTo(p1.x,p1.y);
  
          canvas.drawPath(path, mPaint);
      }
  </code></pre>