From 8451dfa724afb68c8d267702505d90ea94d75029 Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Sat, 28 Jan 2012 13:45:08 +0100 Subject: fix #1044: Compass starts without being chosen --- main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'main/src/cgeo/geocaching/apps/cache') 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; } } -- cgit v1.1