BasePresenter.java 613 B

1234567891011121314151617181920212223242526
  1. package eu.kanade.mangafeed.presenter;
  2. import de.greenrobot.event.EventBus;
  3. import rx.subscriptions.CompositeSubscription;
  4. public class BasePresenter {
  5. public void registerForStickyEvents() {
  6. EventBus.getDefault().registerSticky(this);
  7. }
  8. public void registerForEvents() {
  9. EventBus.getDefault().register(this);
  10. }
  11. public void unregisterForEvents() {
  12. EventBus.getDefault().unregister(this);
  13. }
  14. protected CompositeSubscription subscriptions = new CompositeSubscription();
  15. public void destroySubscriptions() {
  16. subscriptions.unsubscribe();
  17. }
  18. }