diff options
| -rw-r--r-- | main/src/cgeo/geocaching/cgeocaches.java | 2 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/ui/CacheListAdapter.java | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/cgeocaches.java b/main/src/cgeo/geocaching/cgeocaches.java index 5d7841d..b364573 100644 --- a/main/src/cgeo/geocaching/cgeocaches.java +++ b/main/src/cgeo/geocaching/cgeocaches.java @@ -1481,9 +1481,9 @@ public class cgeocaches extends AbstractListActivity implements FilteredActivity currentLoader.reset(); ((OfflineGeocacheListLoader) currentLoader).setListId(listId); ((OfflineGeocacheListLoader) currentLoader).setSearchCenter(coords); + adapter.setComparator(null); // delete current sorting currentLoader.startLoading(); - invalidateOptionsMenuCompatible(); } diff --git a/main/src/cgeo/geocaching/ui/CacheListAdapter.java b/main/src/cgeo/geocaching/ui/CacheListAdapter.java index 3179857..c6aeaa6 100644 --- a/main/src/cgeo/geocaching/ui/CacheListAdapter.java +++ b/main/src/cgeo/geocaching/ui/CacheListAdapter.java @@ -6,12 +6,12 @@ import cgeo.geocaching.CacheDetailActivity; import cgeo.geocaching.Geocache; import cgeo.geocaching.IGeoData; import cgeo.geocaching.R; -import cgeo.geocaching.settings.Settings; import cgeo.geocaching.cgeoapplication; import cgeo.geocaching.enumerations.CacheListType; import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.filter.IFilter; import cgeo.geocaching.geopoint.Geopoint; +import cgeo.geocaching.settings.Settings; import cgeo.geocaching.sorting.CacheComparator; import cgeo.geocaching.sorting.DistanceComparator; import cgeo.geocaching.sorting.EventDateComparator; @@ -645,6 +645,10 @@ public class CacheListAdapter extends ArrayAdapter<Geocache> { } public void setInitialComparator() { + // will be called repeatedly when coming back to the list, therefore check first for an already existing sorting + if (cacheComparator != null) { + return; + } CacheComparator comparator = null; // a null comparator will automatically sort by distance if (cacheListType == CacheListType.HISTORY) { comparator = new VisitComparator(); |
