--- android/TrainInfo/src/dk/thoerup/traininfo/StationLocator.java 2009/08/10 17:01:02 254 +++ android/TrainInfo/src/dk/thoerup/traininfo/StationLocator.java 2009/08/28 06:34:42 285 @@ -36,6 +36,10 @@ public void abortLocationListener() { locManager.removeUpdates(this); } + + public boolean hasLocation() { + return savedLocation != null; + } public void locateStations() { //http://www.google.com/uds/GlocalSearch?callback=google.search.LocalSearch.RawCompletion&context=1&lstkp=0&rsz=small&hl=en&source=gsc&gss=.com&sig=fadf0e8d483d0f70bea11d5905010a16&q=Train%20station&near=56.377424%2C9.656695&key=ABQIAAAA1XbMiDxx_BTCY2_FkPh06RRaGTYH6UMl8mADNa0YKuWNNa8VNxQEerTAUcfkyrr6OwBovxn7TDAH5Q&v=1.0&nocache=1249640467498 @@ -58,7 +62,6 @@ if (bestProv != null) { - savedLocation = locManager.getLastKnownLocation(bestProv); locManager.requestLocationUpdates(bestProv, 0, 0, this); } else { // message that no suitable provider was found @@ -126,12 +129,15 @@ bjbro.setLatitude(56.380745); bjbro.setLongitude(9.655609); + Location hillerod = new Location("gps"); + hillerod.setLatitude(55.929177); + hillerod.setLongitude(12.308095); LocationManager lm = (LocationManager) cntx.getSystemService(Context.LOCATION_SERVICE); if (lm.getProvider("gps2") == null) lm.addTestProvider("gps2", false, true, true, false, false, false, false, 0, Criteria.ACCURACY_FINE ); lm.setTestProviderEnabled("gps2", true); - lm.setTestProviderLocation("gps2", kbh); + lm.setTestProviderLocation("gps2", hillerod); } public static void removeMockLocation(Context cntx) {