altosdroid: Work without GPS available
[fw/altos] / altosdroid / app / src / main / java / org / altusmetrum / AltosDroid / PreloadMapActivity.java
index f911e1ee85e0ef597ae5e69ff9f04a40ada364ab..eb1230116c7cf4406486a7490d89432a95e9e09f 100644 (file)
@@ -356,8 +356,11 @@ public class PreloadMapActivity extends Activity implements AltosLaunchSiteListe
 
                // Listen for GPS and Network position updates
                LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
-
-               locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 1, this);
+               try {
+                       locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 1, this);
+               } catch (Exception e) {
+                       locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1000, 1, this);
+               }
 
                new AltosLaunchSites(this);
        }