summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fietz <Martin.Fietz@gmail.com>2015-11-30 18:52:06 +0100
committerMartin Fietz <Martin.Fietz@gmail.com>2016-01-07 23:16:01 +0100
commit2ad94d582e9c351e1772a9d2c7862910e3bb40ad (patch)
treee05f75a21bc5fef75c0d04e2553846c1786326a3
parent6eca85b409e587bbee2b4754eb4ab1f9571c87b2 (diff)
downloadAntennaPod-2ad94d582e9c351e1772a9d2c7862910e3bb40ad.zip
Minor changes to playback history
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java
index 85586962f..64e3a7da7 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java
@@ -1,6 +1,6 @@
package de.danoeh.antennapod.fragment;
-import android.app.Activity;
+import android.content.Context;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
@@ -14,7 +14,6 @@ import android.view.View;
import android.widget.ListView;
import java.util.List;
-import java.util.concurrent.atomic.AtomicReference;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.activity.MainActivity;
@@ -50,16 +49,13 @@ public class PlaybackHistoryFragment extends ListFragment {
private boolean itemsLoaded = false;
private boolean viewsCreated = false;
- private AtomicReference<Activity> activity = new AtomicReference<Activity>();
-
private List<Downloader> downloaderList;
private Subscription subscription;
@Override
- public void onAttach(Activity activity) {
- super.onAttach(activity);
- this.activity.set(activity);
+ public void onAttach(Context context) {
+ super.onAttach(context);
if (viewsCreated && itemsLoaded) {
onFragmentLoaded();
}
@@ -123,7 +119,6 @@ public class PlaybackHistoryFragment extends ListFragment {
if(subscription != null) {
subscription.unsubscribe();
}
- activity.set(null);
}
@Override
@@ -138,7 +133,7 @@ public class PlaybackHistoryFragment extends ListFragment {
DownloaderUpdate update = event.update;
downloaderList = update.downloaders;
if (adapter != null) {
- adapter.notifyDataSetChanged();
+ adapter.notifyDataSetChanged();
}
}
@@ -210,7 +205,8 @@ public class PlaybackHistoryFragment extends ListFragment {
// played items shoudln't be transparent for this fragment since, *all* items
// in this fragment will, by definition, be played. So it serves no purpose and can make
// it harder to read.
- adapter = new FeedItemlistAdapter(getActivity(), itemAccess, new DefaultActionButtonCallback(activity.get()), true, false);
+ adapter = new FeedItemlistAdapter(getActivity(), itemAccess,
+ new DefaultActionButtonCallback(getActivity()), true, false);
setListAdapter(adapter);
}
setListShown(true);