mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-02-13 09:50:36 +01:00
fix #264, properly handle notes synced to SD card files
This commit is contained in:
parent
7b1e0a5ea0
commit
b239c7c1a2
@ -568,9 +568,11 @@ class MainActivity : SimpleActivity() {
|
||||
|
||||
if (needsStupidWritePermissions(path)) {
|
||||
handleSAFDialog(path) {
|
||||
var document = getDocumentFile(File(path).parent) ?: return@handleSAFDialog
|
||||
if (!File(path).exists()) {
|
||||
document = document.createFile("", path.getFilenameFromPath())!!
|
||||
val document = if (File(path).exists()) {
|
||||
getDocumentFile(path) ?: return@handleSAFDialog
|
||||
} else {
|
||||
val parent = getDocumentFile(File(path).parent) ?: return@handleSAFDialog
|
||||
parent.createFile("", path.getFilenameFromPath())!!
|
||||
}
|
||||
|
||||
contentResolver.openOutputStream(document.uri).apply {
|
||||
|
Loading…
x
Reference in New Issue
Block a user