From e994b77232287b9ccb62e5519b4f36e3465febdf Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 20:50:11 +0100 Subject: [PATCH] try ensuring that the screenshots folders is properly added to the mediastore --- .../gallery/activities/MainActivity.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 d2df2fcf4..ccfaa66f6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -5,6 +5,7 @@ import android.content.ClipData import android.content.Intent import android.net.Uri import android.os.Bundle +import android.os.Environment import android.os.Handler import android.provider.MediaStore import android.support.v7.widget.GridLayoutManager @@ -283,6 +284,17 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { gotDirectories(addTempFolderIfNeeded(it), false) } mCurrAsyncTask!!.execute() + + // try ensuring that the screenshots folders is properly added to the mediastore + if (config.appRunCount < 5) { + Thread { + val pictures = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + val screenshots = File(pictures, "Screenshots") + if (screenshots.exists()) { + scanFile(screenshots) + } + }.start() + } } private fun showSortingDialog() {