From 1d56b2ac8bddf659388d2182318666b83f32ec69 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 19 Oct 2017 19:18:36 +0200 Subject: [PATCH] show a more specific error message when creating .nomedia file fails --- .../com/simplemobiletools/gallery/extensions/activity.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 59d4f2b52..0a2140a6d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt @@ -227,16 +227,18 @@ fun SimpleActivity.addNoMedia(path: String, callback: () -> Unit) { val fileDocument = getFileDocument(path) if (fileDocument?.exists() == true && fileDocument.isDirectory) { fileDocument.createFile("", NOMEDIA) - } else + } else { toast(R.string.unknown_error_occurred) + } } } else { try { file.createNewFile() } catch (e: Exception) { - toast(R.string.unknown_error_occurred) + showErrorToast(e) } } + scanFile(file) { callback() }