RoomDatabase.Callback

public abstract class RoomDatabase.Callback


Callback for RoomDatabase.

Summary

Public constructors

Public methods

void

Called when the database is created for the first time.

void

Called after the database was destructively migrated

void

Called when the database has been opened.

Public constructors

Callback

Added in 2.0.0
public Callback()

Public methods

onCreate

Added in 2.0.0
public void onCreate(@NonNull SupportSQLiteDatabase db)

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

Parameters
@NonNull SupportSQLiteDatabase db

The database.

onDestructiveMigration

Added in 2.2.0
public void onDestructiveMigration(@NonNull SupportSQLiteDatabase db)

Called after the database was destructively migrated

Parameters
@NonNull SupportSQLiteDatabase db

The database.

onOpen

Added in 2.0.0
public void onOpen(@NonNull SupportSQLiteDatabase db)

Called when the database has been opened.

Parameters
@NonNull SupportSQLiteDatabase db

The database.