How do I inject an abstraction using an IOC container like Dagger 2
问题 What I would like to do is to have an abstraction, and pass the abstraction as parameter. So that if one day something better than retrofit comes along and I want to switch it, it will be easy to do so. Although I have no idea on how do it. Here is a basic overview of what I want to do: public interface ApiClient{ Object getClient() } public class RetrofitClient implements ApiClient{ private static Retrofit retrofit = null; @Override public Retrofit getClient(){ if(retrofit == null){