--- android/TrainInfo/src/dk/thoerup/traininfo/TrainInfoList.java 2009/09/10 19:11:48 311 +++ android/TrainInfo/src/dk/thoerup/traininfo/TrainInfoList.java 2009/09/11 09:12:45 317 @@ -154,19 +154,16 @@ double latitude = station.getLatitude(); double longitude = station.getLongitude(); - String addr = station.getAddress(); - if (addr == null || addr.trim().equals("") ) - addr = lookupAddress(latitude, longitude); Intent intent = new Intent(this, DepartureList.class); intent.putExtra("name", station.getName()); - intent.putExtra("address", addr); intent.putExtra("distance", station.getDistance()); intent.putExtra("latitude", latitude); intent.putExtra("longitude", longitude); intent.putExtra("stationid", station.getId()); + intent.putExtra("address", station.getAddress()); startActivity(intent); } @@ -196,7 +193,6 @@ return sb.toString(); } - class LocatorTask extends AsyncTask { @Override protected void onPreExecute() { @@ -208,6 +204,12 @@ protected Void doInBackground(Void... params) { locator.findNearestStations(); + List stations = locator.getStations(); + for (StationBean station : stations) { + String addr = lookupAddress(station.getLatitude(), station.getLongitude()); + station.setAddress(addr); + } + return null; }