How can I delete all entries on specific table using Room Persistence Library? I need to drop table, but I cannot to find any information how to do this.
Only when d
Here is how I have done it in Kotlin.
Inject room db in the activity using DI (Koin).
private val appDB: AppDB by inject()
Then you can simply call clearAllTables()
private fun clearRoomDB() {
GlobalScope.launch {
appDB.clearAllTables()
preferences.put(PreferenceConstants.IS_UPLOADCATEGORIES_SAVED_TO_DB, false)
preferences.put(PreferenceConstants.IS_MEMBERHANDBOOK_SAVED_TO_DB, false)
}
}