reset databases in thread
This commit is contained in:
parent
145765e611
commit
cdac8d9d99
1 changed files with 8 additions and 6 deletions
|
@ -49,12 +49,14 @@ class MaintenanceFragment : DaggerFragment() {
|
||||||
activity?.let { activity ->
|
activity?.let { activity ->
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.maintenance), resourceHelper.gs(R.string.reset_db_confirm), Runnable {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.maintenance), resourceHelper.gs(R.string.reset_db_confirm), Runnable {
|
||||||
MainApp.getDbHelper().resetDatabases()
|
MainApp.getDbHelper().resetDatabases()
|
||||||
// should be handled by Plugin-Interface and
|
Thread {
|
||||||
// additional service interface and plugin registry
|
// should be handled by Plugin-Interface and
|
||||||
foodPlugin.service?.resetFood()
|
// additional service interface and plugin registry
|
||||||
treatmentsPlugin.service.resetTreatments()
|
foodPlugin.service?.resetFood()
|
||||||
Thread { repository.clearDatabases() } .start()
|
treatmentsPlugin.service.resetTreatments()
|
||||||
rxBus.send(EventNewBG(null))
|
repository.clearDatabases()
|
||||||
|
rxBus.send(EventNewBG(null))
|
||||||
|
} .start()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue