mirror of
https://github.com/FossifyOrg/Contacts.git
synced 2026-02-02 11:42:14 -05:00
catch an exception at getting the export destination file
This commit is contained in:
@@ -220,8 +220,12 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
||||
if (requestCode == PICK_IMPORT_SOURCE_INTENT && resultCode == Activity.RESULT_OK && resultData != null && resultData.data != null) {
|
||||
tryImportContactsFromFile(resultData.data!!)
|
||||
} else if (requestCode == PICK_EXPORT_FILE_INTENT && resultCode == Activity.RESULT_OK && resultData != null && resultData.data != null) {
|
||||
val outputStream = contentResolver.openOutputStream(resultData.data!!)
|
||||
exportContactsTo(ignoredExportContactSources, outputStream)
|
||||
try {
|
||||
val outputStream = contentResolver.openOutputStream(resultData.data!!)
|
||||
exportContactsTo(ignoredExportContactSources, outputStream)
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user