aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/apps/cache/navi
diff options
context:
space:
mode:
authorMarco Jacob <mjacob@union06.de>2012-01-11 22:57:50 +0100
committerMarco Jacob <mjacob@union06.de>2012-01-11 22:57:50 +0100
commit42e6aeded98723c3c5b121a2f82fc00eda817b77 (patch)
treec1375f4100e38fca56dcbdfd0c629dfe595c213c /main/src/cgeo/geocaching/apps/cache/navi
parent943ae4421d1363fb465367250b9eb96b8944da08 (diff)
downloadcgeo-42e6aeded98723c3c5b121a2f82fc00eda817b77.zip
cgeo-42e6aeded98723c3c5b121a2f82fc00eda817b77.tar.gz
cgeo-42e6aeded98723c3c5b121a2f82fc00eda817b77.tar.bz2
added setting and implementation for waypoint static map
Diffstat (limited to 'main/src/cgeo/geocaching/apps/cache/navi')
-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;
}
-
}