Google is committed to advancing racial equity for Black communities. See how.

PrepackagedDatabaseCallback

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

Callback for Builder#createFromAsset(String), Builder#createFromFile(File) and Builder#createFromInputStream(Callable)

This callback will be invoked after the pre-package DB is copied but before Room had a chance to open it and therefore before the RoomDatabase.Callback methods are invoked. This callback can be useful for updating the pre-package DB schema to satisfy Room's schema validation.

Summary

Public constructors

Callback for Builder#createFromAsset(String), Builder#createFromFile(File) and Builder#createFromInputStream(Callable)

Public methods
open Unit

Called when the pre-packaged database has been copied.

Public constructors

<init>

PrepackagedDatabaseCallback()

Callback for Builder#createFromAsset(String), Builder#createFromFile(File) and Builder#createFromInputStream(Callable)

This callback will be invoked after the pre-package DB is copied but before Room had a chance to open it and therefore before the RoomDatabase.Callback methods are invoked. This callback can be useful for updating the pre-package DB schema to satisfy Room's schema validation.

Public methods

onOpenPrepackagedDatabase

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

Called when the pre-packaged database has been copied.

Parameters
db SupportSQLiteDatabase: The database.