forked from github/szkolny
[Dialog/EventDetails] Show toast when calendar app not found instead of crashing.
This commit is contained in:
parent
6a54e7fef7
commit
fd48f10df9
@ -4,6 +4,7 @@
|
||||
|
||||
package pl.szczodrzynski.edziennik.ui.dialogs.event
|
||||
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Intent
|
||||
import android.provider.CalendarContract
|
||||
import android.provider.CalendarContract.Events
|
||||
@ -209,6 +210,10 @@ class EventDetailsDialog(
|
||||
}
|
||||
}
|
||||
|
||||
activity.startActivity(intent)
|
||||
try {
|
||||
activity.startActivity(intent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Toast.makeText(activity, R.string.calendar_app_not_found, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}}
|
||||
}
|
||||
|
@ -1160,4 +1160,5 @@
|
||||
<string name="counter_activity_sync">Synchronizuj</string>
|
||||
<string name="notification_day_free">Dzień wolny</string>
|
||||
<string name="edziennik_progress_endpoint_push_config">Konfigurowanie natychmiastowych powiadomień...</string>
|
||||
<string name="calendar_app_not_found">Nie znaleziono aplikacji kalendarza</string>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user