Last active
July 7, 2017 21:41
-
-
Save feresr/12938ff36a6e7b3fbaa1c3c309abf725 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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