Created
April 28, 2016 16:42
-
-
Save ShinjiKobayashi/27dd592658054a19bd0cd43249782a2e 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
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