mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02: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) {
|
if (requestCode == PICK_IMPORT_SOURCE_INTENT && resultCode == Activity.RESULT_OK && resultData != null && resultData.data != null) {
|
||||||
tryImportContactsFromFile(resultData.data!!)
|
tryImportContactsFromFile(resultData.data!!)
|
||||||
} else if (requestCode == PICK_EXPORT_FILE_INTENT && resultCode == Activity.RESULT_OK && resultData != null && resultData.data != null) {
|
} else if (requestCode == PICK_EXPORT_FILE_INTENT && resultCode == Activity.RESULT_OK && resultData != null && resultData.data != null) {
|
||||||
val outputStream = contentResolver.openOutputStream(resultData.data!!)
|
try {
|
||||||
exportContactsTo(ignoredExportContactSources, outputStream)
|
val outputStream = contentResolver.openOutputStream(resultData.data!!)
|
||||||
|
exportContactsTo(ignoredExportContactSources, outputStream)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
showErrorToast(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user