Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShinjiKobayashi/27dd592658054a19bd0cd43249782a2e to your computer and use it in GitHub Desktop.
Save ShinjiKobayashi/27dd592658054a19bd0cd43249782a2e to your computer and use it in GitHub Desktop.
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