do not show the "Exporting..." toast if theres no events to export

This commit is contained in:
tibbi 2017-05-18 21:45:49 +02:00
parent 9c937c2a0d
commit 537afc2f05
1 changed files with 1 additions and 1 deletions

View File

@ -321,7 +321,6 @@ class MainActivity : SimpleActivity(), NavigationListener {
FilePickerDialog(this, pickFile = false) {
val path = it
ExportEventsDialog(this, path) { exportPastEvents, file ->
toast(R.string.exporting)
Thread({
val events = dbHelper.getEventsToExport(exportPastEvents)
if (events.isEmpty()) {
@ -329,6 +328,7 @@ class MainActivity : SimpleActivity(), NavigationListener {
toast(R.string.no_events_for_exporting)
}
} else {
toast(R.string.exporting)
IcsExporter().exportEvents(this, file, events) {
runOnUiThread {
toast(when (it) {