mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
catch and show exceptions thrown at importing events from a file
This commit is contained in:
@ -866,10 +866,14 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
||||
return
|
||||
}
|
||||
|
||||
val inputStream = contentResolver.openInputStream(uri)
|
||||
val out = FileOutputStream(tempFile)
|
||||
inputStream!!.copyTo(out)
|
||||
showImportEventsDialog(tempFile.absolutePath)
|
||||
try {
|
||||
val inputStream = contentResolver.openInputStream(uri)
|
||||
val out = FileOutputStream(tempFile)
|
||||
inputStream!!.copyTo(out)
|
||||
showImportEventsDialog(tempFile.absolutePath)
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
else -> toast(R.string.invalid_file_format)
|
||||
}
|
||||
|
Reference in New Issue
Block a user