fix: overwriting files on SD card
This commit is contained in:
parent
beb62cf4b9
commit
2a3e684c19
1 changed files with 1 additions and 1 deletions
|
@ -1162,7 +1162,7 @@ fun BaseSimpleActivity.getFileOutputStreamSync(path: String, mimeType: String, p
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val newDocument = documentFile.createFile(mimeType, path.getFilenameFromPath()) ?: getDocumentFile(path)
|
val newDocument = getDocumentFile(path) ?: documentFile.createFile(mimeType, path.getFilenameFromPath())
|
||||||
applicationContext.contentResolver.openOutputStream(newDocument!!.uri)
|
applicationContext.contentResolver.openOutputStream(newDocument!!.uri)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
showErrorToast(e)
|
showErrorToast(e)
|
||||||
|
|
Loading…
Reference in a new issue