title: Returning a List correctly
body: <p>How do I return a List correctly? </p>
  
  <p>I am programming an App with OSMdroid and I want to use the variables "longitude" and "latitude" of the class "Place"(on the bottom of this Post) to ultimately use them in the "onPostExecute" method, right where I set the "PLACEHOLDERS".</p>
  
  <p>Android Studio wants me to alter the line "return loadXmlFromNetwork(urls[0]);", which executes the code below, but I dont know how exactly (The methods below are in the same class).</p>
  
  <pre><code>private class DownloadXmlTask extends AsyncTask&lt;String, Void, String&gt; {
      @Override
      protected String doInBackground(String... urls) {
          try {
              //Here I want to recieve the list
              return loadXmlFromNetwork(urls[0]);       
          } catch (IOException e) {
              return getResources().getString(R.string.connection_error);
          } catch (XmlPullParserException e) {
              return getResources().getString(R.string.xml_error);
          }
  
      }
  
      @Override
      protected void onPostExecute(List&lt;Place&gt; result) {
  
          MapView map = (MapView) findViewById(R.id.map);
          IMapController mapController = map.getController();
          mapController.setZoom(17);
          //Here I want to use the latitude and longitude variables of the List
          GeoPoint myLocation = new GeoPoint(PLACEHOLDER(latitude), PLACEHOLDER(longitude)); 
          mapController.animateTo(myLocation);
  
      }
  }
  </code></pre>
  
  <p>This is where I recieve the list for the first time:</p>
  
  <pre><code>private List&lt;Place&gt; loadXmlFromNetwork(String urlString) throws XmlPullParserException, IOException {
      InputStream stream = null;  // Instantiate the parser
      XMLParser XMLParser = new XMLParser();
      List&lt;Place&gt; places = null; 
  
      try {
          stream = downloadUrl(urlString);
          places = XMLParser.parse(stream);  // Makes sure that the InputStream is closed after the app is finished using it.
      } finally {
          if (stream != null) {
              stream.close();
          }
      }
  
      return places;
  }
  </code></pre>
  
  <p>This is my Place class:</p>
  
  <pre><code>public class Place {
      private String longitude;
      private String latitude;
      private String place_id;
  
      public String getLongitude() {
          return longitude;
      }
      public void setLongitude(String longitude) {
          this.longitude = longitude;
      }
  
      public String getLatitude() {
          return latitude;
      }
      public void setLatitude(String latitude) {
          this.latitude = latitude;
      }
  
      public String getPlace_id() {
          return place_id;
      }
      public void setPlace_id(String place_id) {this.place_id = place_id;}
  
      @Override
      public String toString() {
          return "ID: " + place_id + "\n" + "Longitude: " + longitude + "\n" + "Latitude: " + latitude;
  }
  </code></pre>