Skip to content

Instantly share code, notes, and snippets.

@feresr
Last active Jul 7, 2017
Embed
What would you like to do?
RxView.clicks(button)
.flatMap(new Func1<Void, Observable<Data>>() {
@Override
public Observable<Data> call(Void aVoid) {
return apiEndpoints
.getData()
.subscribeOn(Schedulers.io());
}
})
.observeOn(AndroidSchedulers.mainThread())
.subscribe(data -> displayData(data), //onNext(Data data)
error -> Log.e(TAG, t.getMessage()); //onError(Throwable error)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment