diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2014-06-01 09:51:55 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2014-06-01 09:51:55 +0200 |
| commit | 752ad05506ca3e2bc3b11515c1e3720f2ed9352f (patch) | |
| tree | 82442692e297777ccad04662ec85076600690846 /main/src/cgeo/geocaching/loaders/OfflineGeocacheListLoader.java | |
| parent | 6d72fe6ccbad00ec687885451d907b6fbb8936ea (diff) | |
| download | cgeo-752ad05506ca3e2bc3b11515c1e3720f2ed9352f.zip cgeo-752ad05506ca3e2bc3b11515c1e3720f2ed9352f.tar.gz cgeo-752ad05506ca3e2bc3b11515c1e3720f2ed9352f.tar.bz2 | |
fix #3933: switching list leads to onloadfinished of current loader
Diffstat (limited to 'main/src/cgeo/geocaching/loaders/OfflineGeocacheListLoader.java')
| -rw-r--r-- | main/src/cgeo/geocaching/loaders/OfflineGeocacheListLoader.java | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/main/src/cgeo/geocaching/loaders/OfflineGeocacheListLoader.java b/main/src/cgeo/geocaching/loaders/OfflineGeocacheListLoader.java index b80a1b8..0d5af6a 100644 --- a/main/src/cgeo/geocaching/loaders/OfflineGeocacheListLoader.java +++ b/main/src/cgeo/geocaching/loaders/OfflineGeocacheListLoader.java @@ -1,18 +1,20 @@ package cgeo.geocaching.loaders; import cgeo.geocaching.DataStore; +import cgeo.geocaching.Intents; import cgeo.geocaching.SearchResult; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.settings.Settings; import android.content.Context; +import android.os.Bundle; public class OfflineGeocacheListLoader extends AbstractSearchLoader { - private int listId; - private Geopoint searchCenter; + private final int listId; + private final Geopoint searchCenter; - public OfflineGeocacheListLoader(Context context, Geopoint searchCenter, int listId) { + public OfflineGeocacheListLoader(final Context context, final Geopoint searchCenter, final int listId) { super(context); this.searchCenter = searchCenter; this.listId = listId; @@ -23,12 +25,14 @@ public class OfflineGeocacheListLoader extends AbstractSearchLoader { return DataStore.getBatchOfStoredCaches(searchCenter, Settings.getCacheType(), listId); } - public void setListId(int listId) { - this.listId = listId; - } - - public void setSearchCenter(Geopoint searchCenter) { - this.searchCenter = searchCenter; + /** + * @param listId + * @return the bundle needed for querying the LoaderManager for the offline list with the given id + */ + public static Bundle getBundleForList(final int listId) { + final Bundle bundle = new Bundle(); + bundle.putInt(Intents.EXTRA_LIST_ID, listId); + return bundle; } } |
