diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2011-10-09 09:12:25 +0200 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2011-10-09 09:12:25 +0200 |
commit | 97f6b2ec8434efa54114eb9efff7a4ee6ddf8f68 (patch) | |
tree | 63393c60c5f7b0713cd38f34e4bc141af348e5f3 /main/src/cgeo/geocaching/cgeo.java | |
parent | 12ce469d7f0f75c43c13cac65026aa68ac95ba55 (diff) | |
download | cgeo-97f6b2ec8434efa54114eb9efff7a4ee6ddf8f68.zip cgeo-97f6b2ec8434efa54114eb9efff7a4ee6ddf8f68.tar.gz cgeo-97f6b2ec8434efa54114eb9efff7a4ee6ddf8f68.tar.bz2 |
refactoring: make cache list type an enum
* have enum instead of String for cache list type comparisons
* move all invocations of the cache list activity into the class itself
* remove duplicated invocations
* remove cache type extra, it can be read from Settings instead
Diffstat (limited to 'main/src/cgeo/geocaching/cgeo.java')
-rw-r--r-- | main/src/cgeo/geocaching/cgeo.java | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/main/src/cgeo/geocaching/cgeo.java b/main/src/cgeo/geocaching/cgeo.java index 5c8c9f1..7fafcda 100644 --- a/main/src/cgeo/geocaching/cgeo.java +++ b/main/src/cgeo/geocaching/cgeo.java @@ -285,9 +285,7 @@ public class cgeo extends AbstractActivity { context.startActivity(new Intent(context, cgeoinit.class)); return true; case MENU_HISTORY: - final Intent cachesIntent = new Intent(context, cgeocaches.class); - cachesIntent.putExtra("type", "history"); - context.startActivity(cachesIntent); + cgeocaches.startActivityHistory(context); return true; case MENU_SCAN: Intent intent = new Intent(SCAN_INTENT); @@ -619,12 +617,7 @@ public class cgeo extends AbstractActivity { } findViewById(R.id.nearest).setPressed(true); - final Intent cachesIntent = new Intent(context, cgeocaches.class); - cachesIntent.putExtra("type", "nearest"); - cachesIntent.putExtra("latitude", geo.coordsNow.getLatitude()); - cachesIntent.putExtra("longitude", geo.coordsNow.getLongitude()); - cachesIntent.putExtra("cachetype", Settings.getCacheType()); - context.startActivity(cachesIntent); + cgeocaches.startActivityNearest(context, geo.coordsNow); } /** @@ -633,9 +626,7 @@ public class cgeo extends AbstractActivity { */ public void cgeoFindByOffline(View v) { findViewById(R.id.search_offline).setPressed(true); - final Intent cachesIntent = new Intent(context, cgeocaches.class); - cachesIntent.putExtra("type", "offline"); - context.startActivity(cachesIntent); + cgeocaches.startActivityOffline(context); } /** |