在Android项目中,有一个作为单例实现的外观。我认为这是一个更好的想法,把它转换为DI与刀柄SingletonComponent。MyManager @Inject constructor(@ApplicationContext private val ctx: Context){}@AndroidEntryPoint
class MyCallerFragment :
我在读的文章。当我应该添加Hilt注释时,我感到困惑。在代码A中,注入了参数database of fun provideLogDao,但是作者没有添加任何注释,但是fun provideDatabase的参数appContext被标记为注释@ApplicationContext您知道ApplicationContext也是预定义的绑定,但是作者在代码A中的fun provideDatabase中添加了注释@ApplicationConte