Truncate existing file when exporting database

This commit is contained in:
cketti 2022-03-29 00:46:12 +02:00
parent a115bf8cd7
commit 7cd9abb0f6
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ public class DatabaseExporter {
ParcelFileDescriptor pfd = null;
FileOutputStream fileOutputStream = null;
try {
pfd = context.getContentResolver().openFileDescriptor(uri, "w");
pfd = context.getContentResolver().openFileDescriptor(uri, "wt");
fileOutputStream = new FileOutputStream(pfd.getFileDescriptor());
exportToStream(fileOutputStream, context);
} catch (IOException e) {