remember last used vcard export path

This commit is contained in:
tibbi
2020-03-16 22:29:11 +01:00
parent 1b7a860cdf
commit 39b432bf4b
4 changed files with 29 additions and 15 deletions

View File

@ -520,19 +520,18 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
}
private fun exportContacts() {
FilePickerDialog(this, pickFile = false, showFAB = true) {
ExportContactsDialog(this, it) { file, ignoredContactSources ->
ContactsHelper(this).getContacts(true, ignoredContactSources) { contacts ->
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
})
}
ExportContactsDialog(this, config.lastExportPath) { file, ignoredContactSources ->
config.lastExportPath = file.absolutePath.getParentPath()
ContactsHelper(this).getContacts(true, ignoredContactSources) { contacts ->
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
})
}
}
}