diff options
author | Bananeweizen <Bananeweizen@gmx.de> | 2012-01-28 13:45:08 +0100 |
---|---|---|
committer | Bananeweizen <Bananeweizen@gmx.de> | 2012-01-28 13:45:08 +0100 |
commit | 8451dfa724afb68c8d267702505d90ea94d75029 (patch) | |
tree | 34c608b9902781804372a9d47cf7b281b9d4da77 /main/src/cgeo/geocaching/apps/cache | |
parent | f0a17260f57a9c2ce9b989a39e96810ec9ef7823 (diff) | |
download | cgeo-8451dfa724afb68c8d267702505d90ea94d75029.zip cgeo-8451dfa724afb68c8d267702505d90ea94d75029.tar.gz cgeo-8451dfa724afb68c8d267702505d90ea94d75029.tar.bz2 |
fix #1044: Compass starts without being chosen
Diffstat (limited to 'main/src/cgeo/geocaching/apps/cache')
-rw-r--r-- | main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java index 75001f3..13a81ff 100644 --- a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java +++ b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java @@ -49,6 +49,8 @@ public final class NavigationAppFactory extends AbstractAppFactory { public final int id; } + private static final int MENU_ITEM_OFFSET = 12345; + public static void addMenuItems(final Menu menu, final Activity activity) { addMenuItems(menu, activity, true, false); } @@ -59,7 +61,7 @@ public final class NavigationAppFactory extends AbstractAppFactory { for (NavigationAppsEnum navApp : getInstalledNavigationApps(activity)) { if ((showInternalMap || !(navApp.app instanceof InternalMap)) && (showDefaultNavigation || defaultNavigationTool != navApp.id)) { - menu.add(0, navApp.id, 0, navApp.app.getName()); + menu.add(0, MENU_ITEM_OFFSET + navApp.id, 0, navApp.app.getName()); } } } @@ -115,7 +117,7 @@ public final class NavigationAppFactory extends AbstractAppFactory { public static NavigationApp getAppFromMenuItem(MenuItem item) { final int id = item.getItemId(); for (NavigationAppsEnum navApp : NavigationAppsEnum.values()) { - if (navApp.id == id) { + if (MENU_ITEM_OFFSET + navApp.id == id) { return navApp.app; } } |