mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-04-16 08:17:23 +02: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)) {
|
if (needsStupidWritePermissions(path)) {
|
||||||
handleSAFDialog(path) {
|
handleSAFDialog(path) {
|
||||||
var document = getDocumentFile(File(path).parent) ?: return@handleSAFDialog
|
val document = if (File(path).exists()) {
|
||||||
if (!File(path).exists()) {
|
getDocumentFile(path) ?: return@handleSAFDialog
|
||||||
document = document.createFile("", path.getFilenameFromPath())!!
|
} else {
|
||||||
|
val parent = getDocumentFile(File(path).parent) ?: return@handleSAFDialog
|
||||||
|
parent.createFile("", path.getFilenameFromPath())!!
|
||||||
}
|
}
|
||||||
|
|
||||||
contentResolver.openOutputStream(document.uri).apply {
|
contentResolver.openOutputStream(document.uri).apply {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user