Fix saving data to override any existing data in a file

This commit is contained in:
Billy Brawner 2019-11-10 10:39:32 -06:00 committed by William Brawner
parent c42223f796
commit bcb045a70a

View file

@ -49,7 +49,7 @@ class MarkdownViewModel : ViewModel() {
return withContext(Dispatchers.IO) { return withContext(Dispatchers.IO) {
try { try {
val fileName = uri.getName(context) val fileName = uri.getName(context)
val outputStream = context.contentResolver.openOutputStream(uri) val outputStream = context.contentResolver.openOutputStream(uri, "rwt")
?: return@withContext false ?: return@withContext false
outputStream.writer().use { outputStream.writer().use {
it.write(markdownUpdates.value ?: "") it.write(markdownUpdates.value ?: "")