diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/viewmodel/MarkdownViewModel.kt b/app/src/main/java/com/wbrawner/simplemarkdown/viewmodel/MarkdownViewModel.kt index f74f6f8..39d9887 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/viewmodel/MarkdownViewModel.kt +++ b/app/src/main/java/com/wbrawner/simplemarkdown/viewmodel/MarkdownViewModel.kt @@ -49,7 +49,7 @@ class MarkdownViewModel : ViewModel() { return withContext(Dispatchers.IO) { try { val fileName = uri.getName(context) - val outputStream = context.contentResolver.openOutputStream(uri) + val outputStream = context.contentResolver.openOutputStream(uri, "rwt") ?: return@withContext false outputStream.writer().use { it.write(markdownUpdates.value ?: "")