mirror of
https://github.com/MatomoCamp/matomocamp-companion-android.git
synced 2024-09-19 16:13:46 +02:00
Check start time and end time existence when creating the intent to add
an event to the system calendar.
This commit is contained in:
parent
6ff746dd53
commit
151a94864b
1 changed files with 8 additions and 2 deletions
|
@ -268,8 +268,14 @@ public class EventDetailsFragment extends Fragment {
|
|||
description);
|
||||
}
|
||||
intent.putExtra(CalendarContract.Events.DESCRIPTION, description);
|
||||
intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, event.getStartTime().getTime());
|
||||
intent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, event.getEndTime().getTime());
|
||||
Date time = event.getStartTime();
|
||||
if (time != null) {
|
||||
intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, time.getTime());
|
||||
}
|
||||
time = event.getEndTime();
|
||||
if (time != null) {
|
||||
intent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, time.getTime());
|
||||
}
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue