title: Adding points to PolylineOptions in Android GoogleMap api 2 not working
body: <p>I am trying to add Polylines from the points I added to my GoogleMap.
  They should be displayed on the road (set as .geodesic(true).
  When I add only two points from my xml there is drawn a line but it is not geodesic...
  But the real problem is: if I try to add all point which are in my XML the App isn't working at all. Does anybody have an idea what might be wrong with my code?</p>
  
  <p>XML File:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;resources&gt;
  
   &lt;string-array name="coordinates"&gt;
      &lt;item name="waypoint1"&gt;50.991185 , 7.131250&lt;/item&gt;
      &lt;item name="waypoint2"&gt;50.990601 , 7.131534&lt;/item&gt;
      &lt;item name="waypoint3"&gt;50.991678 , 7.130603&lt;/item&gt;
      &lt;item name="waypoint4"&gt;51.000614 , 7.137122&lt;/item&gt; 
      &lt;item name="waypoint5"&gt;51.003929, 7.146833&lt;/item&gt; 
      &lt;item name="waypoint6"&gt;51.003853, 7.146931&lt;/item&gt; 
      &lt;item name="waypoint7"&gt;51.003697, 7.147666&lt;/item&gt; 
      &lt;item name="waypoint8"&gt;51.003964, 7.148090&lt;/item&gt; 
      &lt;item name="waypoint9"&gt;51.003982, 7.148470&lt;/item&gt; 
   &lt;/string-array&gt; 
     &lt;/resources&gt;
  </code></pre>
  
  <p>Method which isn't working:</p>
  
  <pre><code>    private void drawline(){
      String[] coordinates = getResources().getStringArray(R.array.coordinates);
      List&lt;LatLng&gt; waypoints = new ArrayList&lt;LatLng&gt;();
      LatLng[] latlng = new LatLng[coordinates.length];
  
  
      for(int i=0;i &lt; coordinates.length;i++){
          String coordinate[] = coordinates[i].split(",");
          double x = Double.parseDouble(coordinate[i]);
          double y = Double.parseDouble(coordinate[i]);
          latlng[i] = new LatLng(x,y);    
      } 
  
      for (int i=0; i &lt; coordinates.length; i++){
      waypoints.add(latlng[i]);   
      }
  
      PolylineOptions options = new PolylineOptions()
          .color(Color.BLUE)
          .geodesic(true)
          .width(5)
          .addAll(waypoints);
  
      Polyline pfad = mMap.addPolyline(options);
      }
  </code></pre>
  
  <p>I tried lots of different ways to save my coordinates as LatLng List but it never worked.
  I would be really happy if anybode can help me.
  Maybe there's also an idea why the lines aren't drawn as geodestic lines.</p>