Dagger 2 - injecting multiple objects of same type using @Named not working
问题 My module: @Module public class TcpManagerModule { private ITcpConnection eventsTcpConnection; private ITcpConnection commandsTcpConnection; public TcpManagerModule(Context context) { eventsTcpConnection = new EventsTcpConnection(context); commandsTcpConnection = new CommandsTcpConnection(context); } @Provides @Named("events") public ITcpConnection provideEventsTcpConnection() { return eventsTcpConnection; } @Provides @Named("commands") public ITcpConnection provideCommandsTcpConnection() {