diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index 5a8925adc..ee9920b88 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -239,7 +239,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { config.tempSkipDeleteConfirmation = false mTempShowHiddenHandler.removeCallbacksAndMessages(null) removeTempFolder() - GalleryDatabase.destroyInstance() + + if (!config.showAll) { + GalleryDatabase.destroyInstance() + } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt index 4dca15ec7..c0edd6a93 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt @@ -34,6 +34,7 @@ import com.simplemobiletools.commons.views.MyRecyclerView import com.simplemobiletools.gallery.pro.R import com.simplemobiletools.gallery.pro.adapters.MediaAdapter import com.simplemobiletools.gallery.pro.asynctasks.GetMediaAsynctask +import com.simplemobiletools.gallery.pro.databases.GalleryDatabase import com.simplemobiletools.gallery.pro.dialogs.ChangeGroupingDialog import com.simplemobiletools.gallery.pro.dialogs.ChangeSortingDialog import com.simplemobiletools.gallery.pro.dialogs.ExcludeFolderDialog @@ -192,6 +193,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { if (config.showAll && !isChangingConfigurations) { config.temporarilyShowHidden = false config.tempSkipDeleteConfirmation = false + GalleryDatabase.destroyInstance() } mTempShowHiddenHandler.removeCallbacksAndMessages(null)