@Singleton
@Provides
public RoomDB provideRoomDB(Context context) {
RoomDatabase.Builder<RoomDB> roomDatabase = Room.databaseBuilder(context, RoomDB.class, RoomDB.NAME_DB).addCallback(new RoomDatabase.Callback() {
@Override
public void onCreate(@NonNull SupportSQLiteDatabase db) {
super.onCreate(db);
//если тут запущу поток
}
});
return roomDatabase.build();
}