Closed HarryHaiVn closed 6 years ago
Because the creation of the database and the migration happens before onCreate
has a chance to be called.
so after the method databaseBuilder
is called the database is guaranteed to be created and you can perform your logic there.
I'm curious, why you need to know when the DB is created?
return RoomAsset.databaseBuilder(appContext, AppDatabase.class, DATABASE_NAME) .addCallback(new Callback() { @Override public void onCreate(@NonNull SupportSQLiteDatabase db) { super.onCreate(db); Log.d("RoomAsset:------", "onCreate"); }