Instantly share code, notes, and snippets.

Embed
What would you like to do?
final ApiService service = retrofit.create(ApiService.class);
service.login()
.subscribeOn(Schedulers.newThread())
.observeOn(Schedulers.newThread())
.flatMap(response -> {
if (response.getErrCode != 0) {
return null;
}
return service.getDataFromWeb();
})
.subscribe(response -> {
// do something
}, err -> {
// handle err
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment