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
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();
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) {
}
@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
// 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);
}