How do I tell Dagger 2 which implementation to instantiate based on X?

后端 未结 3 691
既然无缘
既然无缘 2021-01-18 04:31

Inside a module, if I need to provide a different implementation of an interface based on a variable known at module construction time I can put the logic inside the @Provid

3条回答
  •  耶瑟儿~
    2021-01-18 05:03

    Have you tried something like this?

    public class hectic extends Iam {
    
        String tokenizer heccas = new string tokenizer();
    }
    

提交回复
热议问题