Set dynamic base url using Retrofit 2.0 and Dagger 2

前端 未结 8 581
南旧
南旧 2020-11-27 12:36

I\'m trying to perform a login action using Retrofit 2.0 using Dagger 2

Here\'s how I set up Retrofit dependency

@Provides
@Singleton
Retrofit provid         


        
8条回答
  •  旧巷少年郎
    2020-11-27 12:41

    For latest Retrofit library, you can simply use singleton instance and change it with retrofitInstance.newBuilder().baseUrl(newUrl). No need to create another instance.

提交回复
热议问题