Skip to content

Instantly share code, notes, and snippets.

@malmstein
Created July 11, 2014 08:11
Show Gist options
  • Select an option

  • Save malmstein/e22328ef018e394ddd91 to your computer and use it in GitHub Desktop.

Select an option

Save malmstein/e22328ef018e394ddd91 to your computer and use it in GitHub Desktop.
RxSubscriber
private static final class ConcertDataSubscriber extends Subscriber<ConcertItem> {
private final ConcertListAdapter adapter;
private ConcertDataSubscriber(final ConcertListAdapter adapter) {
this.adapter = adapter;
}
@Override
public void onCompleted() {
unsubscribe();
}
@Override
public void onError(final Throwable e) {
Log.e("while loading data", e);
}
@Override
public void onNext(final ConcertItem item) {
adapter.addConcertItem(item);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment