Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simple singleton to keep information on orientation change
- Loading branch information
1 parent
eadd5cb
commit 6ae9866
Showing
2 changed files
with
30 additions
and
18 deletions.
There are no files selected for viewing
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
21 changes: 21 additions & 0 deletions
21
AndroidRxInAction/app/src/main/java/com/nhpatt/androidrxinaction/RetrofitService.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.nhpatt.androidrxinaction; | ||
|
||
import com.nhpatt.androidrxinaction.retrofit.GitHubService; | ||
|
||
import retrofit.GsonConverterFactory; | ||
import retrofit.Retrofit; | ||
import retrofit.RxJavaCallAdapterFactory; | ||
|
||
/** | ||
* @author Javier Gamarra | ||
*/ | ||
public class RetrofitService { | ||
public static GitHubService getGithub() { | ||
Retrofit retrofit = new Retrofit.Builder() | ||
.baseUrl("https://api.github.com") | ||
.addConverterFactory(GsonConverterFactory.create()) | ||
.addCallAdapterFactory(RxJavaCallAdapterFactory.create()) | ||
.build(); | ||
return retrofit.create(GitHubService.class); | ||
} | ||
} |