String data = DataAccess.getInstance().loadText(dataType, calendarItemId);
int alarmMinutes;
String itemTitle;
if (dataType == DataAccess.APPOINTMENT) {
Appointment appointment = new Appointment(data);
alarmMinutes = appointment.getAlarmMinutes();
itemTitle = appointment.getTitle();
}
else {
Task task = new Task(data);
alarmMinutes = task.getAlarmMinutes();
itemTitle = task.getTitle();