Android Room with a View - Kotlin: Code on page 8 is out of date, parts won't compile.
Compton103 opened this issue · 0 comments
Compton103 commented
fun getDatabase(context: Context): WordRoomDatabase {
// if the INSTANCE is not null, then return it,
// if it is, then create the database
return INSTANCE ?: synchronized(this) {
val instance = Room.databaseBuilder(
context.applicationContext,
WordRoomDatabase::class.java,
"word_database"
).build()
INSTANCE = instance
// return instance
instance
}}
This code on page 8 won't compile.