]> git.gag.com Git - fw/altos/blobdiff - altosdroid/app/src/main/java/org/altusmetrum/AltosDroid/PreloadMapActivity.java
doc: Add 1.9.22 release notes
[fw/altos] / altosdroid / app / src / main / java / org / altusmetrum / AltosDroid / PreloadMapActivity.java
index a9f30f119c240973d0df8f11225964c6550e1c67..cd0ce70b0e1c8e2ea34d6dad8729c7993c4bcbee 100644 (file)
@@ -33,7 +33,7 @@ import android.location.Location;
 import android.location.LocationManager;
 import android.location.LocationListener;
 
-import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altoslib_14.*;
 
 /**
  * This Activity appears as a dialog. It lists any paired devices and
@@ -134,8 +134,8 @@ public class PreloadMapActivity extends Activity implements AltosLaunchSiteListe
                        if (selected_item != null)
                                known_sites_spinner.setSelection(known_sites_adapter.getPosition(selected_item));
                        else {
-                               latitude.setText(new StringBuffer(String.format("%12.6f", current_location_site.latitude)));
-                               longitude.setText(new StringBuffer(String.format("%12.6f", current_location_site.longitude)));
+                               latitude.setText(new StringBuffer(String.format(Locale.getDefault(), "%12.6f", current_location_site.latitude)));
+                               longitude.setText(new StringBuffer(String.format(Locale.getDefault(), "%12.6f", current_location_site.longitude)));
                        }
                } else {
                        current_location_site.latitude = location.getLatitude();
@@ -279,8 +279,8 @@ public class PreloadMapActivity extends Activity implements AltosLaunchSiteListe
        class SiteListListener implements OnItemSelectedListener {
                public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
                        AltosLaunchSite site = (AltosLaunchSite) parent.getItemAtPosition(pos);
-                       latitude.setText(new StringBuffer(String.format("%12.6f", site.latitude)));
-                       longitude.setText(new StringBuffer(String.format("%12.6f", site.longitude)));
+                       latitude.setText(new StringBuffer(String.format(Locale.getDefault(), "%12.6f", site.latitude)));
+                       longitude.setText(new StringBuffer(String.format(Locale.getDefault(), "%12.6f", site.longitude)));
                }
                public void onNothingSelected(AdapterView<?> parent) {
                }
@@ -296,10 +296,10 @@ public class PreloadMapActivity extends Activity implements AltosLaunchSiteListe
 
        @Override
        protected void onCreate(Bundle savedInstanceState) {
+               setTheme(AltosDroid.dialog_themes[AltosDroidPreferences.font_size()]);
                super.onCreate(savedInstanceState);
 
                // Setup the window
-               requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
                setContentView(R.layout.map_preload);
 
                // Set result CANCELED incase the user backs out
@@ -356,8 +356,14 @@ 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 (SecurityException e) {
+                       try {
+                               locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1000, 1, this);
+                       } catch (SecurityException se) {
+                       }
+               }
 
                new AltosLaunchSites(this);
        }