Launch the appropriate activity for a given event type

This commit is contained in:
Naveen 2022-06-28 09:47:12 +05:30
parent 188a31df7a
commit 48d26b4ab2

View File

@ -336,7 +336,8 @@ fun Context.getNotification(pendingIntent: PendingIntent, event: Event, content:
private fun getFormattedEventTime(startTime: String, endTime: String) = if (startTime == endTime) startTime else "$startTime \u2013 $endTime"
private fun getPendingIntent(context: Context, event: Event): PendingIntent {
val intent = Intent(context, EventActivity::class.java)
val activityClass = if (event.isTask()) TaskActivity::class.java else EventActivity::class.java
val intent = Intent(context, activityClass)
intent.putExtra(EVENT_ID, event.id)
intent.putExtra(EVENT_OCCURRENCE_TS, event.startTS)
return PendingIntent.getActivity(context, event.id!!.toInt(), intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)