Giacomo De Bacco Giacomo De Bacco - 1 year ago 120
Java Question

Show event information with ExtendedCalendarView

I'm trying to create a custom calendar for show events and relative informations in my app.
But I don't know how to show this informations. That's the code of the calendar:

protected void onCreate(Bundle savedInstanceState)
ExtendedCalendarView calendar = (ExtendedCalendarView)findViewById(;
ContentValues values = new ContentValues();
values.put(CalendarProvider.COLOR, Event.COLOR_BLUE);
values.put(CalendarProvider.DESCRIPTION, "Some Description");
values.put(CalendarProvider.LOCATION, "Some location");
values.put(CalendarProvider.EVENT, "Event name");

Calendar cal = Calendar.getInstance();
TimeZone tz = TimeZone.getDefault();
cal.set(startDayYear, startDayMonth, startDayDay, startTimeHour, startTimeMin);
int StartDayJulian = Time.getJulianDay(cal.getTimeInMillis(), TimeUnit.MILLISECONDS.toSeconds(tz.getOffset(cal.getTimeInMillis())));
values.put(CalendarProvider.START, cal.getTimeInMillis());
values.put(CalendarProvider.START_DAY, StartDayJulian);

cal.set(endDayYear, endDayMonth, endDayDay, endTimeHour, endTimeMin);
int endDayJulian = Time.getJulianDay(cal.getTimeInMillis(), TimeUnit.MILLISECONDS.toSeconds(tz.getOffset(cal.getTimeInMillis())));

values.put(CalendarProvider.END, cal.getTimeInMillis());
values.put(CalendarProvider.END_DAY, endDayJulian);

// Uri uri = getContentResolver().insert(CalendarProvider.CONTENT_URI, values);

I can see the calendar and the Event , but probably i've to implement some "Onclick" method for display the infomations. Anyone that are using this library that can help me? Beacuse i can't find any information about.
Thank you.

Answer Source

I've found the answer by myself.

cal.setOnDayClickListener(new OnDayClickListener() {
        public void onDayClicked(AdapterView<?> adapter, View view,
                int position, long id, Day day) {

            dayIsClicked = true;
            clickedDay = day;

            list.setAdapter(new ListaAdapter(context, R.layout.itemlist,




private void getScheduleDetails(Day day) {

itemsList = new ArrayList();

for (Event e : day.getEvents())