Dagger2 Optimal way to inject dependencies from two different classes
问题 After searching and trying too many things i'm stuck in some what seems like an easy problem. Below is my module which is reponsible for injecting retrofit. @Module public class NetworkingModule { @Provides public Retrofit providesRetrofit() { Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.UPPER_CAMEL_CASE).create(); Retrofit retrofit = new Retrofit.Builder() .baseUrl(Constants.BASE_URL) .addConverterFactory(GsonConverterFactory.create(gson)) .build(); return retrofit; }