diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-12-17 21:58:43 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-12-19 19:47:38 +0100 |
commit | ab772e55f5dea02c9f69cb876cd7b3aa0c02b2ed (patch) | |
tree | 179f7cb2f7c5d68961e46c5ca7e768d953374553 /core/src/main/java | |
parent | 120db7ae7e7edf0716cbdebfac024f96a0888d40 (diff) | |
download | AntennaPod-ab772e55f5dea02c9f69cb876cd7b3aa0c02b2ed.zip |
Replaced FeedItemDialog with ItemFragment
Diffstat (limited to 'core/src/main/java')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/asynctask/DBTaskLoader.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/asynctask/DBTaskLoader.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/DBTaskLoader.java new file mode 100644 index 000000000..0f402f44a --- /dev/null +++ b/core/src/main/java/de/danoeh/antennapod/core/asynctask/DBTaskLoader.java @@ -0,0 +1,29 @@ +package de.danoeh.antennapod.core.asynctask; + +import android.content.Context; +import android.support.v4.content.AsyncTaskLoader; + +/** + * Subclass of AsyncTaskLoader that is made for loading data with one of the DB*-classes. + * This class will provide a useful default implementation that would otherwise always be necessary when interacting + * with the DB*-classes with an AsyncTaskLoader. + */ +public abstract class DBTaskLoader<D> extends AsyncTaskLoader<D> { + + public DBTaskLoader(Context context) { + super(context); + } + + @Override + protected void onStopLoading() { + super.onStopLoading(); + cancelLoad(); + } + + @Override + protected void onStartLoading() { + super.onStartLoading(); + // according to https://code.google.com/p/android/issues/detail?id=14944, this has to be called manually + forceLoad(); + } +} |