--- android/TrainInfo/src/dk/thoerup/traininfo/StationList.java 2009/10/29 10:49:14 483 +++ android/TrainInfo/src/dk/thoerup/traininfo/StationList.java 2010/01/22 11:28:56 546 @@ -2,7 +2,7 @@ import java.util.ArrayList; import java.util.List; -import java.util.Locale; + import android.app.AlertDialog; import android.app.Dialog; @@ -12,14 +12,12 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; -import android.location.Address; -import android.location.Geocoder; import android.location.Location; import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.os.Message; -import android.util.Log; + import android.view.ContextMenu; import android.view.LayoutInflater; import android.view.Menu; @@ -135,16 +133,16 @@ } protected void setTitle() { - String dialogTitle; + String dialogTitle = getResources().getString(R.string.app_name); switch (listType) { case ListNearest: - dialogTitle = "TrainInfo DK - Nearby stations"; + dialogTitle += " - Nearby stations"; break; case ListSearch: - dialogTitle = "TrainInfo DK - Search"; + dialogTitle += " - Search"; break; case ListFavorites: - dialogTitle = "TrainInfo DK - Favorites"; + dialogTitle += " - Favorites"; break; default: dialogTitle = "";//not possible @@ -190,7 +188,6 @@ case OPTIONS_MAP: Intent intent = new Intent(this,StationMapView.class); - intent.putExtra("userlocation", location ); ArrayList stationPoints = new ArrayList(); for (StationBean st : stations ) { @@ -207,7 +204,8 @@ message.append("Location info:\n"); message.append("-Obtained by: ").append(loc != null ? loc.getProvider() : "-").append("\n"); message.append("-Accuracy: ").append(loc != null ? (int)loc.getAccuracy() : "-").append("m\n"); - + message.append("-Latitude: ").append(loc != null ? loc.getLatitude() : "-").append("\n"); + message.append("-Longitude: ").append(loc != null ? loc.getLongitude() : "-").append("\n"); MessageBox.showMessage(this, message.toString()); break; default: @@ -357,6 +355,7 @@ } + /* TODO: Remove this no longer needed function String lookupAddress(double latitude, double longitude) { Geocoder coder = new Geocoder(this, new Locale("da")); @@ -381,7 +380,7 @@ } return sb.toString(); - } + }*/ //////////////////////////////////////////////////////////////////////////// @@ -495,10 +494,7 @@ List stations = stationProvider.getStations(); for (StationBean station : stations) { - String addr = lookupAddress(station.getLatitude(), station.getLongitude()); - station.setAddress(addr); - - + if (method.equals(LookupMethod.ByName) || method.equals(LookupMethod.ByList)) { if (loc != null) { //only do the distance calc if we have a location dummy.setLatitude(station.getLatitude());