I’ve been trying to prepopulate my DB with a RoomDatabase.Callbac() and I see that it is only populated if I fetch the data first (just like it was some sort of lazy way). The problem is that once it’s populated, I don’t get the data back. In theory, it should be prepopulated the first time the DB is initialized, and I’m doing so in a Koin module:
Copy code
val databaseModule = module {
single { HeritageDatabase.getDatabase(get()) }
single { get<HeritageDatabase>().heritageDao() }
}
d
diesieben07
01/13/2020, 8:39 AM
single
has a parameter called
createdAtStart
, which is
false
by default. However I would argue that this is abusing DI. Dependency definitions (like