diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 86a61e771..40ae7d726 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -190,7 +190,9 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { config.temporarilyShowHidden = false mTempShowHiddenHandler.removeCallbacksAndMessages(null) removeTempFolder() - GalleryDataBase.destroyInstance() + if (!isChangingConfigurations) { + GalleryDataBase.destroyInstance() + } } override fun onCreateOptionsMenu(menu: Menu): Boolean {