diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-02-25 10:47:37 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-02-25 10:47:37 +0100 |
commit | 955d296638b240d8bbf4be8cce4b27485ac4c517 (patch) | |
tree | 16a35b7a9493495a8e5f7a87ed646a2d166c7fe0 /src/de/danoeh/antennapod/activity/DownloadLogActivity.java | |
parent | f9e00f72a0dfeea3e5b9db8a522f7251e158dc7d (diff) | |
download | AntennaPod-955d296638b240d8bbf4be8cce4b27485ac4c517.zip |
Implemented EventDistributor
Diffstat (limited to 'src/de/danoeh/antennapod/activity/DownloadLogActivity.java')
-rw-r--r-- | src/de/danoeh/antennapod/activity/DownloadLogActivity.java | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/de/danoeh/antennapod/activity/DownloadLogActivity.java b/src/de/danoeh/antennapod/activity/DownloadLogActivity.java index e8a75e9cd..232a7ba1d 100644 --- a/src/de/danoeh/antennapod/activity/DownloadLogActivity.java +++ b/src/de/danoeh/antennapod/activity/DownloadLogActivity.java @@ -1,9 +1,5 @@ package de.danoeh.antennapod.activity; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; import android.os.Bundle; import com.actionbarsherlock.app.SherlockListActivity; @@ -11,6 +7,7 @@ import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; import de.danoeh.antennapod.adapter.DownloadLogAdapter; +import de.danoeh.antennapod.feed.EventDistributor; import de.danoeh.antennapod.feed.FeedManager; import de.danoeh.antennapod.preferences.UserPreferences; @@ -38,14 +35,13 @@ public class DownloadLogActivity extends SherlockListActivity { @Override protected void onPause() { super.onPause(); - unregisterReceiver(contentUpdate); + EventDistributor.getInstance().unregister(contentUpdate); } @Override protected void onResume() { super.onResume(); - registerReceiver(contentUpdate, new IntentFilter( - FeedManager.ACTION_DOWNLOADLOG_UPDATE)); + EventDistributor.getInstance().register(contentUpdate); dla.notifyDataSetChanged(); } @@ -66,12 +62,11 @@ public class DownloadLogActivity extends SherlockListActivity { return true; } - private BroadcastReceiver contentUpdate = new BroadcastReceiver() { - + private EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { + @Override - public void onReceive(Context context, Intent intent) { - if (intent.getAction() - .equals(FeedManager.ACTION_DOWNLOADLOG_UPDATE)) { + public void update(EventDistributor eventDistributor, Integer arg) { + if ((arg & EventDistributor.DOWNLOADLOG_UPDATE) != 0) { dla.notifyDataSetChanged(); } } |