aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/apps/cache
diff options
context:
space:
mode:
authorBananeweizen <Bananeweizen@gmx.de>2012-01-20 23:52:05 -0800
committerBananeweizen <Bananeweizen@gmx.de>2012-01-20 23:52:05 -0800
commit77ab71551adec6644026fb656e493ba04fb11050 (patch)
treeb66f676814eb7eafc95e2278d4f96467e2e80808 /main/src/cgeo/geocaching/apps/cache
parent76628532f9b3c548078f27b861889771214ea61f (diff)
parent133635a3ae8c9df612bd69c25af9b85b5c564aba (diff)
downloadcgeo-77ab71551adec6644026fb656e493ba04fb11050.zip
cgeo-77ab71551adec6644026fb656e493ba04fb11050.tar.gz
cgeo-77ab71551adec6644026fb656e493ba04fb11050.tar.bz2
Merge pull request #988 from marco-jacob/master
Fix #349
Diffstat (limited to 'main/src/cgeo/geocaching/apps/cache')
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/StaticMapApp.java22
1 files changed, 14 insertions, 8 deletions
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/StaticMapApp.java b/main/src/cgeo/geocaching/apps/cache/navi/StaticMapApp.java
index 6a29895..0bf2f56 100644
--- a/main/src/cgeo/geocaching/apps/cache/navi/StaticMapApp.java
+++ b/main/src/cgeo/geocaching/apps/cache/navi/StaticMapApp.java
@@ -2,10 +2,10 @@ package cgeo.geocaching.apps.cache.navi;
import cgeo.geocaching.R;
import cgeo.geocaching.SearchResult;
+import cgeo.geocaching.StaticMapsActivity;
import cgeo.geocaching.cgCache;
import cgeo.geocaching.cgGeo;
import cgeo.geocaching.cgWaypoint;
-import cgeo.geocaching.StaticMapsActivity;
import cgeo.geocaching.activity.ActivityMixin;
import cgeo.geocaching.geopoint.Geopoint;
@@ -28,18 +28,24 @@ class StaticMapApp extends AbstractNavigationApp {
public boolean invoke(cgGeo geo, Activity activity, cgCache cache,
final SearchResult search, cgWaypoint waypoint, final Geopoint coords) {
- if (cache == null || cache.getListId() == 0) {
+ String geocode = null;
+ if (cache != null && cache.getListId() != 0) {
+ geocode = cache.getGeocode().toUpperCase();
+ }
+ if (waypoint != null) {
+ geocode = waypoint.getGeocode().toUpperCase();
+ }
+ if (geocode == null) {
ActivityMixin.showToast(activity, getString(R.string.err_detail_no_map_static));
return true;
- }
-
- if (cache.getGeocode() != null) {
+ } else {
final Intent intent = new Intent(activity, StaticMapsActivity.class);
- intent.putExtra("geocode", cache.getGeocode().toUpperCase());
+ intent.putExtra("geocode", geocode);
+ if (waypoint != null) {
+ intent.putExtra("waypoint", waypoint.getId());
+ }
activity.startActivity(intent);
return true;
}
- return false;
}
-
}