Material-Calendar-View: setOnDayClickListener is not executing

setOnDayClickListener is not executing in version 1.3.2 and I am not using app:datePicker=“true” in xml. What is the problem?

my xml code looks like below:

**<com.applandeo.materialcalendarview.CalendarView
        android:id="@+id/calendarview_picker"
        android:layout_width="match_parent"
        android:layout_height="380dp"
        app:headerColor="@color/lightBlue"
        app:type="one_day_picker"
        app:datePicker="false"
        android:divider="@android:color/transparent"
        app:selectionColor="@color/colorAccent"
        app:todayLabelColor="@color/colorPrimaryDark" />**

Note: I am using this in Dialog. When i debug my app and click on date setOnDayClickListener is not executing. Please help. My code is below:

final CalendarView calendarview_picker = (CalendarView) dialog.findViewById(R.id.calendarview_picker);
            calendarview_picker.setOnDayClickListener(new OnDayClickListener() {
                public Date start_date,end_date;
                @Override
                public void onDayClick(EventDay eventDay) {
                    int size = calendarview_picker.getSelectedDates().size();
                    start_date = eventDay.getCalendar().getTime();
                }
            });

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (4 by maintainers)

Most upvoted comments

simulator screen shot nov 30 2017 7 10 46 pm

See this image, I need two date to be select. Hope you understand what i want. Please help me on this. How can i achieve this @kormateusz @mateuszSawa