Truncate existing file when exporting database
This commit is contained in:
parent
a115bf8cd7
commit
7cd9abb0f6
|
@ -27,7 +27,7 @@ public class DatabaseExporter {
|
||||||
ParcelFileDescriptor pfd = null;
|
ParcelFileDescriptor pfd = null;
|
||||||
FileOutputStream fileOutputStream = null;
|
FileOutputStream fileOutputStream = null;
|
||||||
try {
|
try {
|
||||||
pfd = context.getContentResolver().openFileDescriptor(uri, "w");
|
pfd = context.getContentResolver().openFileDescriptor(uri, "wt");
|
||||||
fileOutputStream = new FileOutputStream(pfd.getFileDescriptor());
|
fileOutputStream = new FileOutputStream(pfd.getFileDescriptor());
|
||||||
exportToStream(fileOutputStream, context);
|
exportToStream(fileOutputStream, context);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
Loading…
Reference in New Issue