destroy ContactsDatabase on app exit

This commit is contained in:
tibbi 2018-11-06 10:28:41 +01:00
parent 17e10c7016
commit 02a7d76196
1 changed files with 4 additions and 0 deletions

View File

@ -22,6 +22,7 @@ import com.simplemobiletools.commons.models.Release
import com.simplemobiletools.contacts.pro.BuildConfig
import com.simplemobiletools.contacts.pro.R
import com.simplemobiletools.contacts.pro.adapters.ViewPagerAdapter
import com.simplemobiletools.contacts.pro.databases.ContactsDatabase
import com.simplemobiletools.contacts.pro.dialogs.ChangeSortingDialog
import com.simplemobiletools.contacts.pro.dialogs.ExportContactsDialog
import com.simplemobiletools.contacts.pro.dialogs.FilterContactSourcesDialog
@ -173,6 +174,9 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
override fun onDestroy() {
super.onDestroy()
config.lastUsedViewPagerPage = viewpager.currentItem
if (!isChangingConfigurations) {
ContactsDatabase.destroyInstance()
}
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {