mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-01-26 16:45:11 +01:00
destroy the DB instance on leaving the app
This commit is contained in:
parent
b532c7852e
commit
4ed323e60e
@ -19,6 +19,7 @@ import androidx.core.view.MenuItemCompat
|
|||||||
import com.simplemobiletools.calendar.pro.BuildConfig
|
import com.simplemobiletools.calendar.pro.BuildConfig
|
||||||
import com.simplemobiletools.calendar.pro.R
|
import com.simplemobiletools.calendar.pro.R
|
||||||
import com.simplemobiletools.calendar.pro.adapters.EventListAdapter
|
import com.simplemobiletools.calendar.pro.adapters.EventListAdapter
|
||||||
|
import com.simplemobiletools.calendar.pro.databases.EventsDatabase
|
||||||
import com.simplemobiletools.calendar.pro.dialogs.ExportEventsDialog
|
import com.simplemobiletools.calendar.pro.dialogs.ExportEventsDialog
|
||||||
import com.simplemobiletools.calendar.pro.dialogs.FilterEventTypesDialog
|
import com.simplemobiletools.calendar.pro.dialogs.FilterEventTypesDialog
|
||||||
import com.simplemobiletools.calendar.pro.dialogs.ImportEventsDialog
|
import com.simplemobiletools.calendar.pro.dialogs.ImportEventsDialog
|
||||||
@ -149,6 +150,13 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
closeSearch()
|
closeSearch()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
super.onDestroy()
|
||||||
|
if (!isChangingConfigurations) {
|
||||||
|
EventsDatabase.destroyInstance()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||||
menuInflater.inflate(R.menu.menu_main, menu)
|
menuInflater.inflate(R.menu.menu_main, menu)
|
||||||
menu.apply {
|
menu.apply {
|
||||||
|
Loading…
Reference in New Issue
Block a user