Created
April 28, 2017 14:29
-
-
Save b00sti/ff0e2154e70175c0d6f648291b32a1d5 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
public static Observable<User> getFromApi(String username) { | |
Retrofit retrofit = new Retrofit.Builder() | |
.addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io())) | |
.addConverterFactory(GsonConverterFactory.create()) | |
.baseUrl(ENDPOINT) | |
.build(); | |
UserService apiService = retrofit.create(UserService.class); | |
return apiService.getUser(username); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment