diff options
Diffstat (limited to 'main/src/cgeo/geocaching/apps')
3 files changed, 18 insertions, 11 deletions
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java index c00723d..4d98e42 100644 --- a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java +++ b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java @@ -27,6 +27,10 @@ import java.util.List; public final class NavigationAppFactory extends AbstractAppFactory { + private NavigationAppFactory() { + // utility class + } + public enum NavigationAppsEnum { /** The internal compass activity */ COMPASS(new CompassApp(), 0, R.string.pref_navigation_menu_compass), diff --git a/main/src/cgeo/geocaching/apps/cachelist/CacheListAppFactory.java b/main/src/cgeo/geocaching/apps/cachelist/CacheListAppFactory.java index 5886168..b6706a0 100644 --- a/main/src/cgeo/geocaching/apps/cachelist/CacheListAppFactory.java +++ b/main/src/cgeo/geocaching/apps/cachelist/CacheListAppFactory.java @@ -17,6 +17,11 @@ import java.util.ArrayList; import java.util.List; public final class CacheListAppFactory extends AbstractAppFactory { + + private CacheListAppFactory() { + // utility class + } + private static class LazyHolder { public static final CacheListApp[] apps = { new InternalCacheListMap(), @@ -71,10 +76,10 @@ public final class CacheListAppFactory extends AbstractAppFactory { } if (app != null) { try { - boolean result = app.invoke(caches, activity, search); + final boolean result = app.invoke(caches, activity, search); ActivityMixin.invalidateOptionsMenu(activity); return result; - } catch (Exception e) { + } catch (final Exception e) { Log.e("CacheListAppFactory.onMenuItemSelected", e); } } diff --git a/main/src/cgeo/geocaching/apps/cachelist/MapsWithMeCacheListApp.java b/main/src/cgeo/geocaching/apps/cachelist/MapsWithMeCacheListApp.java index ba177f0..c6c7709 100644 --- a/main/src/cgeo/geocaching/apps/cachelist/MapsWithMeCacheListApp.java +++ b/main/src/cgeo/geocaching/apps/cachelist/MapsWithMeCacheListApp.java @@ -26,10 +26,10 @@ public class MapsWithMeCacheListApp extends AbstractApp implements CacheListApp } @Override - public boolean invoke(List<Geocache> caches, Activity activity, SearchResult search) { + public boolean invoke(final List<Geocache> caches, final Activity activity, final SearchResult search) { final MWMPoint[] points = new MWMPoint[caches.size()]; for (int i = 0; i < points.length; i++) { - Geocache geocache = caches.get(i); + final Geocache geocache = caches.get(i); points[i] = new MWMPoint(geocache.getCoords().getLatitude(), geocache.getCoords().getLongitude(), geocache.getName(), geocache.getGeocode()); } MapsWithMeApi.showPointsOnMap(activity, null, getPendingIntent(activity), points); @@ -44,22 +44,20 @@ public class MapsWithMeCacheListApp extends AbstractApp implements CacheListApp /** * get cache code from a PendingIntent after an invocation of MapsWithMe - * + * * @return */ @Nullable public static String getCacheFromMapsWithMe(final Context context, final Intent intent) { final MWMResponse mwmResponse = MWMResponse.extractFromIntent(context, intent); - if (mwmResponse != null) { - final MWMPoint point = mwmResponse.getPoint(); - if (point != null) { - return point.getId(); - } + final MWMPoint point = mwmResponse.getPoint(); + if (point != null) { + return point.getId(); } return null; } - private static PendingIntent getPendingIntent(Context context) { + private static PendingIntent getPendingIntent(final Context context) { final Intent intent = new Intent(context, CacheDetailActivity.class); return PendingIntent.getActivity(context, 0, intent, 0); } |
