diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt index db7d9335e..e0fe03a6c 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt @@ -254,7 +254,8 @@ fun BaseSimpleActivity.rescanDeletedFile(file: File, callback: () -> Unit) { MediaScannerConnection.scanFile(applicationContext, arrayOf(file.absolutePath), null, { s, uri -> try { contentResolver.delete(uri, null, null) - } catch (ignored: Exception) { + } catch (e: Exception) { + showErrorToast(e) } callback() }) @@ -291,7 +292,7 @@ fun BaseSimpleActivity.renameFile(oldFile: File, newFile: File, callback: (succe callback(false) } } catch (e: SecurityException) { - toast(R.string.unknown_error_occurred) + showErrorToast(e) callback(false) } }