diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt index 8e3d4d6c4..4c2dc55f4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt @@ -228,7 +228,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener } private fun scanFinalPath(path: String) { - scanPath(path) { + applicationContext.scanPath(path) { setResult(Activity.RESULT_OK, intent) toast(R.string.file_saved) finish() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/IncludedFoldersActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/IncludedFoldersActivity.kt index cb565c6b3..a7a3229b5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/IncludedFoldersActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/IncludedFoldersActivity.kt @@ -55,7 +55,7 @@ class IncludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener { config.addIncludedFolder(it) updateFolders() Thread { - scanPath(it) + applicationContext.scanPath(it) }.start() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt index aba3b7060..c86e22888 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt @@ -64,14 +64,14 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList mIsFromGallery = intent.getBooleanExtra(IS_FROM_GALLERY, false) if (mUri!!.scheme == "file") { - scanPath(mUri!!.path) + applicationContext.scanPath(mUri!!.path) sendViewPagerIntent(mUri!!.path) finish() return } else { val path = applicationContext.getRealPathFromURI(mUri!!) ?: "" if (path != mUri.toString() && path.isNotEmpty() && mUri!!.authority != "mms") { - scanPath(mUri!!.path) + applicationContext.scanPath(mUri!!.path) sendViewPagerIntent(path) finish() return diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 77557ea0b..30f8d5ae2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -205,7 +205,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } reloadViewPager() - scanPath(mPath) + applicationContext.scanPath(mPath) if (config.blackBackground) { view_pager.background = ColorDrawable(Color.BLACK) @@ -530,7 +530,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View deleteFile(newFile) } copyFile(tmpFile, newFile) - scanFile(newFile) + applicationContext.scanFile(newFile) toast(R.string.file_saved) if (config.keepLastModified) { @@ -799,7 +799,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View deleteFile(file, true) } - scanPath(mDirectory) + applicationContext.scanPath(mDirectory) } private fun checkOrientation() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt index e2780eb71..46a10186f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt @@ -116,7 +116,7 @@ fun BaseSimpleActivity.addNoMedia(path: String, callback: () -> Unit) { } } - scanFile(file) { + applicationContext.scanFile(file) { callback() } }