diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2014-07-06 18:23:56 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2014-07-06 18:47:46 +0200 |
| commit | 6c6380aea82d40af491fd9bba22ce44f89e8c902 (patch) | |
| tree | daff4ab35cc4c965ee03eb0071037c76dd7b64c9 | |
| parent | 0bf25c427d933172a683c080ff6325413db36142 (diff) | |
| download | cgeo-6c6380aea82d40af491fd9bba22ce44f89e8c902.zip cgeo-6c6380aea82d40af491fd9bba22ce44f89e8c902.tar.gz cgeo-6c6380aea82d40af491fd9bba22ce44f89e8c902.tar.bz2 | |
fix #4000: "All caches" list not remembered
| -rw-r--r-- | main/src/cgeo/geocaching/CacheListActivity.java | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/main/src/cgeo/geocaching/CacheListActivity.java b/main/src/cgeo/geocaching/CacheListActivity.java index 0eded88..4e03c19 100644 --- a/main/src/cgeo/geocaching/CacheListActivity.java +++ b/main/src/cgeo/geocaching/CacheListActivity.java @@ -518,7 +518,7 @@ public class CacheListActivity extends AbstractListActivity implements FilteredA } // refresh standard list if it has changed (new caches downloaded) - if (type == CacheListType.OFFLINE && listId >= StoredList.STANDARD_LIST_ID && search != null) { + if (type == CacheListType.OFFLINE && (listId >= StoredList.STANDARD_LIST_ID || listId == PseudoList.ALL_LIST.id) && search != null) { final SearchResult newSearch = DataStore.getBatchOfStoredCaches(coords, Settings.getCacheType(), listId); if (newSearch.getTotalCountGC() != search.getTotalCountGC()) { refreshCurrentList(); @@ -1351,13 +1351,17 @@ public class CacheListActivity extends AbstractListActivity implements FilteredA return; } - final StoredList list = DataStore.getList(id); - if (list == null) { - return; + if (id == PseudoList.ALL_LIST.id) { + listId = id; + title = res.getString(R.string.list_all_lists); + } else { + final StoredList list = DataStore.getList(id); + if (list == null) { + return; + } + listId = list.id; + title = list.title; } - - listId = list.id; - title = list.title; type = CacheListType.OFFLINE; Settings.saveLastList(listId); @@ -1567,11 +1571,12 @@ public class CacheListActivity extends AbstractListActivity implements FilteredA // open either the requested or the last list if (extras.containsKey(Intents.EXTRA_LIST_ID)) { listId = extras.getInt(Intents.EXTRA_LIST_ID); - } - else { + } else { listId = Settings.getLastList(); } - if (listId <= StoredList.TEMPORARY_LIST_ID) { + if (listId == PseudoList.ALL_LIST.id) { + title = res.getString(R.string.list_all_lists); + } else if (listId <= StoredList.TEMPORARY_LIST_ID) { listId = StoredList.STANDARD_LIST_ID; title = res.getString(R.string.stored_caches_button); } else { |
