diff options
Diffstat (limited to 'main/src/cgeo/geocaching/apps')
-rw-r--r-- | main/src/cgeo/geocaching/apps/cache/navi/StaticMapApp.java | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/StaticMapApp.java b/main/src/cgeo/geocaching/apps/cache/navi/StaticMapApp.java index a0eb5a1..db316bd 100644 --- a/main/src/cgeo/geocaching/apps/cache/navi/StaticMapApp.java +++ b/main/src/cgeo/geocaching/apps/cache/navi/StaticMapApp.java @@ -1,5 +1,6 @@ package cgeo.geocaching.apps.cache.navi; +import cgeo.geocaching.ILogable; import cgeo.geocaching.R; import cgeo.geocaching.StaticMapsActivity; import cgeo.geocaching.cgCache; @@ -25,25 +26,20 @@ class StaticMapApp extends AbstractNavigationApp { @Override public boolean invoke(cgGeo geo, Activity activity, cgCache cache, cgWaypoint waypoint, final Geopoint coords) { - - String geocode = null; - if (cache != null && cache.getListId() != 0) { - geocode = cache.getGeocode().toUpperCase(); - } - if (waypoint != null) { - geocode = waypoint.getGeocode().toUpperCase(); - } + final ILogable logable = cache != null && cache.getListId() != 0 ? cache : waypoint; + final String geocode = logable.getGeocode().toUpperCase(); if (geocode == null) { ActivityMixin.showToast(activity, getString(R.string.err_detail_no_map_static)); return true; - } else { - final Intent intent = new Intent(activity, StaticMapsActivity.class); - intent.putExtra("geocode", geocode); - if (waypoint != null) { - intent.putExtra("waypoint", waypoint.getId()); - } - activity.startActivity(intent); - return true; } + + final Intent intent = new Intent(activity, StaticMapsActivity.class); + intent.putExtra("geocode", geocode); + if (waypoint != null) { + intent.putExtra("waypoint", waypoint.getId()); + } + activity.startActivity(intent); + + return true; } } |