Skip to content

Instantly share code, notes, and snippets.

@markchristopherng
Created April 20, 2020 00:12
Show Gist options
  • Save markchristopherng/5c645210c046b36b34470c23e31ab0b1 to your computer and use it in GitHub Desktop.
Save markchristopherng/5c645210c046b36b34470c23e31ab0b1 to your computer and use it in GitHub Desktop.
val builder = Retrofit.Builder()
.client(getClient(serviceClass))
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.addConverterFactory(GuavaOptionalConverterFactory.create())
.addConverterFactory(GsonConverterFactory.create(gson))
.baseUrl(endpointAdapter.getURLString(context, serviceClass.simpleName))
.addConverterFactory(Json.asConverterFactory(MediaType.get("application/json")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment