From 5592c23c4e9d7ee00d79dda18dd0e895a6f9df6c Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 10 Mar 2019 09:58:50 +0100 Subject: [PATCH] ignore the photoFetcher at Android versions below 7 --- .../gallery/pro/activities/MainActivity.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 2d838281b..f0eaac7cd 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 @@ -368,9 +368,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } private fun startNewPhotoFetcher() { - val photoFetcher = NewPhotoFetcher() - if (isNougatPlus() && !photoFetcher.isScheduled(applicationContext)) { - photoFetcher.scheduleJob(applicationContext) + if (isNougatPlus()) { + val photoFetcher = NewPhotoFetcher() + if (!photoFetcher.isScheduled(applicationContext)) { + photoFetcher.scheduleJob(applicationContext) + } } }