For development purpose, is there a way to automatically empty all Room data when I rebuild and restart the program? The way I can think of right now is to call some kind of removeAll at the start of the program.
You can simply use RoomDatabase#clearAllTables();
Sample usage:
if (BuildConfig.DEBUG) {
database.clearAllTables();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With