Last active
May 17, 2018 06:24
-
-
Save Menris/c392032b1275d4fd49c8bdfcd8d12fa3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Room.databaseBuilder(context, AppDatabase.class, | |
DB_NAME) | |
.allowMainThreadQueries() | |
.fallbackToDestructiveMigration() | |
.addCallback(new RoomDatabase.Callback() { | |
@Override | |
public void onCreate(@NonNull SupportSQLiteDatabase db) { | |
super.onCreate(db); | |
Executors.newSingleThreadExecutor().execute(() -> { | |
//заполнение базы | |
}); | |
} | |
@Override | |
public void onOpen(@NonNull SupportSQLiteDatabase db) { | |
super.onOpen(db); | |
} | |
}) | |
.build(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment