aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/ui
diff options
context:
space:
mode:
authorBananeweizen <Bananeweizen@gmx.de>2013-07-29 09:08:18 +0200
committerBananeweizen <Bananeweizen@gmx.de>2013-07-29 09:08:18 +0200
commitf07696a4fc105388d970099213954c190409c45f (patch)
treef04908bf351190d4ee480243351b23fb6dfa233e /main/src/cgeo/geocaching/ui
parenta0566f5c5b53e5bb554a0537eaeb79b2fc0aa211 (diff)
downloadcgeo-f07696a4fc105388d970099213954c190409c45f.zip
cgeo-f07696a4fc105388d970099213954c190409c45f.tar.gz
cgeo-f07696a4fc105388d970099213954c190409c45f.tar.bz2
fix #3067: sort order unstable when coming back from details
* do not reset sort order when loading cache list * only reset explicitly when switching lists
Diffstat (limited to 'main/src/cgeo/geocaching/ui')
-rw-r--r--main/src/cgeo/geocaching/ui/CacheListAdapter.java6
1 files changed, 5 insertions, 1 deletions
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();