mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-19 05:16:56 -06:00
[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
|
package pl.szczodrzynski.edziennik.ui.dialogs.event
|
||||||
|
|
||||||
|
import android.content.ActivityNotFoundException
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.provider.CalendarContract
|
import android.provider.CalendarContract
|
||||||
import android.provider.CalendarContract.Events
|
import android.provider.CalendarContract.Events
|
||||||
@ -209,6 +210,10 @@ class EventDetailsDialog(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
activity.startActivity(intent)
|
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="counter_activity_sync">Synchronizuj</string>
|
||||||
<string name="notification_day_free">Dzień wolny</string>
|
<string name="notification_day_free">Dzień wolny</string>
|
||||||
<string name="edziennik_progress_endpoint_push_config">Konfigurowanie natychmiastowych powiadomień...</string>
|
<string name="edziennik_progress_endpoint_push_config">Konfigurowanie natychmiastowych powiadomień...</string>
|
||||||
|
<string name="calendar_app_not_found">Nie znaleziono aplikacji kalendarza</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user