pass an OutputStream to exporter instead of a File

This commit is contained in:
tibbi
2020-03-16 23:09:25 +01:00
parent fbfe7133ca
commit eb4be51f92
3 changed files with 133 additions and 135 deletions

View File

@ -526,12 +526,14 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
if (contacts.isEmpty()) {
toast(R.string.no_entries_for_exporting)
} else {
VcfExporter().exportContacts(this, file, contacts, true) { result ->
toast(when (result) {
VcfExporter.ExportResult.EXPORT_OK -> R.string.exporting_successful
VcfExporter.ExportResult.EXPORT_PARTIAL -> R.string.exporting_some_entries_failed
else -> R.string.exporting_failed
})
getFileOutputStream(file.toFileDirItem(this), true) {
VcfExporter().exportContacts(this, it, contacts, true) { result ->
toast(when (result) {
VcfExporter.ExportResult.EXPORT_OK -> R.string.exporting_successful
VcfExporter.ExportResult.EXPORT_PARTIAL -> R.string.exporting_some_entries_failed
else -> R.string.exporting_failed
})
}
}
}
}