Skip to content

Instantly share code, notes, and snippets.

View WicherW's full-sized avatar
🏠
Working from home

Kamil Wichrowski WicherW

🏠
Working from home
  • Szczecin, Polska
View GitHub Profile
@AdamMc331
AdamMc331 / AppDatabase.kt
Created September 16, 2017 18:53
Shows how a RoomDatabase.Callback can be used to add database triggers when a database is created.
@Database(...)
abstract class AppDatabase : RoomDatabase() {
abstract fun appDao(): AppDao
companion object {
private var INSTANCE: AppDatabase? = null
private set
fun getInMemoryDatabase(context: Context): CCDatabase {
if (INSTANCE == null) {