aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2012-06-03 12:03:35 +0200
committerBananeweizen <bananeweizen@gmx.de>2012-06-03 12:03:35 +0200
commit75f3a1f33b50e8db4180ea2f073a34a4948d5ba0 (patch)
treef90ae1a0d9df9a8395f2c7ef4f3bab005eb638c5 /main/src
parent1337d4cc0d22a0e26e991c97dd9cac9c71ac8026 (diff)
downloadcgeo-75f3a1f33b50e8db4180ea2f073a34a4948d5ba0.zip
cgeo-75f3a1f33b50e8db4180ea2f073a34a4948d5ba0.tar.gz
cgeo-75f3a1f33b50e8db4180ea2f073a34a4948d5ba0.tar.bz2
fix #1581: to many updates in cache list
Diffstat (limited to 'main/src')
-rw-r--r--main/src/cgeo/geocaching/ui/CacheListAdapter.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/ui/CacheListAdapter.java b/main/src/cgeo/geocaching/ui/CacheListAdapter.java
index c6d3404..25a8fdc 100644
--- a/main/src/cgeo/geocaching/ui/CacheListAdapter.java
+++ b/main/src/cgeo/geocaching/ui/CacheListAdapter.java
@@ -292,7 +292,13 @@ public class CacheListAdapter extends ArrayAdapter<cgCache> {
if (coords == null) {
return;
}
+ final ArrayList<cgCache> oldList = new ArrayList<cgCache>(list);
Collections.sort(list, new DistanceComparator(coords, list));
+
+ // avoid an update if the list has not changed due to location update
+ if (list.equals(oldList)) {
+ return;
+ }
notifyDataSetChanged();
lastSort = System.currentTimeMillis();
}