aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/apps/cache
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2012-06-03 09:05:52 +0200
committerBananeweizen <bananeweizen@gmx.de>2012-06-03 09:05:52 +0200
commitd384d2cd3f45a1559ae721a7fd30333fd7d1e61b (patch)
treed409b796f1898e8730fa7cb3a8afc734b17ef578 /main/src/cgeo/geocaching/apps/cache
parent133c78c84688c5cb6fe8ba5651e4815b6a0ff634 (diff)
downloadcgeo-d384d2cd3f45a1559ae721a7fd30333fd7d1e61b.zip
cgeo-d384d2cd3f45a1559ae721a7fd30333fd7d1e61b.tar.gz
cgeo-d384d2cd3f45a1559ae721a7fd30333fd7d1e61b.tar.bz2
fix #1701: Offline logging does not work from cache details
Diffstat (limited to 'main/src/cgeo/geocaching/apps/cache')
-rw-r--r--main/src/cgeo/geocaching/apps/cache/GeneralAppsFactory.java15
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java10
2 files changed, 14 insertions, 11 deletions
diff --git a/main/src/cgeo/geocaching/apps/cache/GeneralAppsFactory.java b/main/src/cgeo/geocaching/apps/cache/GeneralAppsFactory.java
index 22ce677..98e7db8 100644
--- a/main/src/cgeo/geocaching/apps/cache/GeneralAppsFactory.java
+++ b/main/src/cgeo/geocaching/apps/cache/GeneralAppsFactory.java
@@ -31,14 +31,15 @@ public final class GeneralAppsFactory extends AbstractAppFactory {
public static boolean onMenuItemSelected(final MenuItem item, Activity activity, cgCache cache) {
final GeneralApp app = (GeneralApp) getAppFromMenuItem(item, apps);
- if (app != null) {
- try {
- return app.invoke(activity, cache);
- } catch (Exception e) {
- Log.e("GeneralAppsFactory.onMenuItemSelected: " + e.toString());
- }
+ if (app == null) {
+ return false;
+ }
+ try {
+ app.invoke(activity, cache);
+ } catch (Exception e) {
+ Log.e("GeneralAppsFactory.onMenuItemSelected: " + e.toString());
}
- return false;
+ return true;
}
}
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
index 8219320..cd8fea4 100644
--- a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
+++ b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
@@ -224,8 +224,9 @@ public final class NavigationAppFactory extends AbstractAppFactory {
* @return
*/
public static boolean onMenuItemSelected(final MenuItem item, Activity activity, cgCache cache) {
- navigateCache(activity, cache, getAppFromMenuItem(item));
- return true;
+ final App menuItem = getAppFromMenuItem(item);
+ navigateCache(activity, cache, menuItem);
+ return menuItem != null;
}
private static void navigateCache(Activity activity, cgCache cache, App app) {
@@ -236,8 +237,9 @@ public final class NavigationAppFactory extends AbstractAppFactory {
}
public static boolean onMenuItemSelected(final MenuItem item, Activity activity, cgWaypoint waypoint) {
- navigateWaypoint(activity, waypoint, getAppFromMenuItem(item));
- return true;
+ final App menuItem = getAppFromMenuItem(item);
+ navigateWaypoint(activity, waypoint, menuItem);
+ return menuItem != null;
}
private static void navigateWaypoint(Activity activity, cgWaypoint waypoint, App app) {