--- android/TrainInfo/src/dk/thoerup/traininfo/StationList.java 2010/06/26 11:02:53 918 +++ android/TrainInfo/src/dk/thoerup/traininfo/StationList.java 2010/07/02 14:58:44 948 @@ -48,13 +48,14 @@ public static final int OPTIONS_MAP = 2003; public static final int OPTIONS_GPSINFO = 2004; - - - public static final int DLG_PROGRESS = 3001; public static final int DLG_STATIONNAME = 3002; + + public static final int GPS_TIMEOUT_MS = 17500; //how long are we willing to wait for gps fix -in milliseconds + + static enum LookupMethod { ByLocation, ByName, @@ -148,6 +149,10 @@ if (findStationsTask != null) { findStationsTask.cancel(true); } + if (locationLookup != null) { + locationLookup.stopSearch(); + } + isRunning = false; } @@ -391,7 +396,7 @@ showDialogSafe(DLG_PROGRESS); locationLookup.locateStations(); - stationsFetched.sendEmptyMessageDelayed(LOCATIONFIXTIMEOUT, 20000); + stationsFetched.sendEmptyMessageDelayed(LOCATIONFIXTIMEOUT, GPS_TIMEOUT_MS); } void startNameSearch(String name) {