我怎樣才能從組件中返回非單例對(duì)象@Singleton?例如我有:ApplicationComponent.kt@Singleton@Component(modules = [ApplicationModule::class])interface ApplicationComponent() { fun database(): Database fun model(): Model}Model.ktclass Model @Inject constructor()Model我想要的是每次都返回一個(gè)不同的實(shí)例,相反Database,它將是一個(gè)單身人士,并由ApplicationModule.kt
Dagger2:從單例組件返回的不是單例對(duì)象
動(dòng)漫人物
2023-03-02 16:34:23