Google 致力于为黑人社区推动种族平等。查看具体举措

RoomDatabase.PrepackagedDatabaseCallback

public static abstract class RoomDatabase.PrepackagedDatabaseCallback
extends Object

java.lang.Object
   ↳ androidx.room.RoomDatabase.PrepackagedDatabaseCallback


Callback for RoomDatabase.Builder.createFromAsset(String), RoomDatabase.Builder.createFromFile(File) and RoomDatabase.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

PrepackagedDatabaseCallback()

Public methods

void onOpenPrepackagedDatabase(SupportSQLiteDatabase db)

Called when the pre-packaged database has been copied.

Inherited methods

Public constructors

PrepackagedDatabaseCallback

public PrepackagedDatabaseCallback ()

Public methods

onOpenPrepackagedDatabase

public void onOpenPrepackagedDatabase (SupportSQLiteDatabase db)

Called when the pre-packaged database has been copied.

Parameters
db SupportSQLiteDatabase: The database.