show a more specific error message when creating .nomedia file fails
This commit is contained in:
parent
2dbbc2bbdb
commit
1d56b2ac8b
1 changed files with 4 additions and 2 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue