diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2012-04-16 13:45:20 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2012-04-16 13:51:50 +0200 |
| commit | 3a73e71c360076553262c9b308b8a4bf5ecf4450 (patch) | |
| tree | ebd3ce4a52d94f814362a1f4bb62fe11a406458b /main/src | |
| parent | d9505ffab25f265faa37bcae664db50c8d2763ac (diff) | |
| download | cgeo-3a73e71c360076553262c9b308b8a4bf5ecf4450.zip cgeo-3a73e71c360076553262c9b308b8a4bf5ecf4450.tar.gz cgeo-3a73e71c360076553262c9b308b8a4bf5ecf4450.tar.bz2 | |
Refactoring: now that Geopoint is parcelable, use it in bundles
Diffstat (limited to 'main/src')
| -rw-r--r-- | main/src/cgeo/geocaching/maps/CGeoMap.java | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java index bb844a5..4060c87 100644 --- a/main/src/cgeo/geocaching/maps/CGeoMap.java +++ b/main/src/cgeo/geocaching/maps/CGeoMap.java @@ -95,8 +95,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto //Menu private static final String EXTRAS_GEOCODE = "geocode"; - private static final String EXTRAS_LONGITUDE = "longitude"; - private static final String EXTRAS_LATITUDE = "latitude"; + private static final String EXTRAS_COORDS = "coords"; private static final String EXTRAS_WPTTYPE = "wpttype"; private static final String EXTRAS_MAPSTATE = "mapstate"; private static final String EXTRAS_SEARCH = "search"; @@ -387,16 +386,10 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto if (extras != null) { searchIntent = (SearchResult) extras.getParcelable(EXTRAS_SEARCH); geocodeIntent = extras.getString(EXTRAS_GEOCODE); - final double latitudeIntent = extras.getDouble(EXTRAS_LATITUDE); - final double longitudeIntent = extras.getDouble(EXTRAS_LONGITUDE); - coordsIntent = new Geopoint(latitudeIntent, longitudeIntent); + coordsIntent = (Geopoint) extras.getParcelable(EXTRAS_COORDS); waypointTypeIntent = WaypointType.findById(extras.getString(EXTRAS_WPTTYPE)); mapStateIntent = extras.getIntArray(EXTRAS_MAPSTATE); mapTitle = extras.getString(EXTRAS_MAP_TITLE); - - if (coordsIntent.getLatitude() == 0.0 || coordsIntent.getLongitude() == 0.0) { - coordsIntent = null; - } } if (StringUtils.isBlank(mapTitle)) { @@ -1687,8 +1680,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto public static void startActivityCoords(final Activity fromActivity, final Geopoint coords, final WaypointType type, final String title) { final Intent mapIntent = newIntent(fromActivity); - mapIntent.putExtra(EXTRAS_LATITUDE, coords.getLatitude()); - mapIntent.putExtra(EXTRAS_LONGITUDE, coords.getLongitude()); + mapIntent.putExtra(EXTRAS_COORDS, coords); if (type != null) { mapIntent.putExtra(EXTRAS_WPTTYPE, type.id); } |
