Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

Callback

abstract class Callback
kotlin.Any
   ↳ androidx.room.RoomDatabase.Callback

Callback for RoomDatabase.

Summary

Public constructors

Callback for RoomDatabase.

Public methods
open Unit

Called when the database is created for the first time.

open Unit

Called when the database has been opened.

Public constructors

<init>

Callback()

Callback for RoomDatabase.

Public methods

onCreate

open fun onCreate(@NonNull db: SupportSQLiteDatabase): Unit

Called when the database is created for the first time. This is called after all the tables are created.

Parameters
db SupportSQLiteDatabase: The database.

onOpen

open fun onOpen(@NonNull db: SupportSQLiteDatabase): Unit

Called when the database has been opened.

Parameters
db SupportSQLiteDatabase: The database.