207 |
if (loc != null) { |
if (loc != null) { |
208 |
message.append( getString(stationlist_obtainedby) ).append( loc.getProvider() ).append("\n"); |
message.append( getString(stationlist_obtainedby) ).append( loc.getProvider() ).append("\n"); |
209 |
message.append( getString(stationlist_accuracy) ).append( (int)loc.getAccuracy()).append("m\n"); |
message.append( getString(stationlist_accuracy) ).append( (int)loc.getAccuracy()).append("m\n"); |
210 |
message.append( getString(stationlist_latitude) ).append( loc.getLatitude()).append("\n"); |
message.append( getString(stationlist_latitude) ).append( (float)loc.getLatitude()).append("\n"); |
211 |
message.append( getString(stationlist_longitude) ).append( loc.getLongitude() ).append("\n"); |
message.append( getString(stationlist_longitude) ).append( (float)loc.getLongitude() ).append("\n"); |
212 |
} else { |
} else { |
213 |
message.append( getString(stationlist_nolocation) ); |
message.append( getString(stationlist_nolocation) ); |
214 |
} |
} |
364 |
findStationsTask.searchByLocation( locationLookup.getLocation() ); |
findStationsTask.searchByLocation( locationLookup.getLocation() ); |
365 |
findStationsTask.execute(); |
findStationsTask.execute(); |
366 |
} |
} |
|
|
|
|
|
|
|
/* TODO: Remove this no longer needed function |
|
|
String lookupAddress(double latitude, double longitude) { |
|
|
|
|
|
Geocoder coder = new Geocoder(this, new Locale("da")); |
|
|
StringBuilder sb = new StringBuilder(); |
|
|
Log.i("lookupaddr", "" + latitude + "/" + longitude); |
|
|
try { |
|
|
List<Address> addressList = coder.getFromLocation(latitude, longitude, 1); |
|
|
Address addr = addressList.get(0); |
|
|
|
|
|
|
|
|
int max = addr.getMaxAddressLineIndex(); |
|
|
for (int i=0; i<max; i++) { |
|
|
if (i>0) |
|
|
sb.append(", "); |
|
|
|
|
|
sb.append(addr.getAddressLine(i)); |
|
|
} |
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
Log.e("DepartureList", "geocoder failed", e); |
|
|
} |
|
367 |
|
|
|
return sb.toString(); |
|
|
}*/ |
|
|
|
|
368 |
|
|
369 |
//////////////////////////////////////////////////////////////////////////// |
//////////////////////////////////////////////////////////////////////////// |
370 |
// Inner classes |
// Inner classes |
500 |
|
|
501 |
|
|
502 |
if (success) { |
if (success) { |
503 |
if (stationProvider.getStations().size() == 0) |
if (stationProvider.getStations().size() == 0) { |
504 |
MessageBox.showMessage(StationList.this, getString(stationlist_nostations) ); // this should not be possible !?! |
showMessageAndClose(getString(stationlist_nostations)); |
505 |
|
} |
506 |
stations = stationProvider.getStations(); |
stations = stationProvider.getStations(); |
507 |
adapter.setStations( stations ); |
adapter.setStations( stations ); |
508 |
|
|