1
0
Fork 0
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:
Christophe Beyls 2014-01-25 16:57:29 +01:00
parent 6ff746dd53
commit 151a94864b

View file

@ -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);
}