Created
May 11, 2018 17:56
-
-
Save brendoncheung/7859789f06e4df4382c49decdfa6a026 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
import retrofit2.Retrofit; | |
import retrofit2.converter.gson.GsonConverterFactory; | |
public class RetrofitClient { | |
private static Retrofit retrofit = null; | |
public static Retrofit getClient(String baseUrl) { | |
if (retrofit==null) { | |
retrofit = new Retrofit.Builder() | |
.baseUrl(baseUrl) | |
.addConverterFactory(GsonConverterFactory.create()) | |
.build(); | |
} | |
return retrofit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment