question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using MaterialCalendarView#setSelectedDate does not fire off listeners

See original GitHub issue

Trying to use com.prolificinteractive.materialcalendarview.MaterialCalendarView#setSelectedDate(com.prolificinteractive.materialcalendarview.CalendarDay) in order to pre-select a date on the calendar and it’s not firing off the com.prolificinteractive.materialcalendarview.OnDateSelectedListener set in com.prolificinteractive.materialcalendarview.MaterialCalendarView#setOnDateChangedListener. Is this working as intended, or is there another way to ensure that the listeners are fired accordingly?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
krazykiracommented, Mar 21, 2017

Yes, that is working as intended. I don’t think that setting a date as selected programatically will fire off the OnDateSelectedListener event. You should manually do whatever you’re doing inside the OnDateSelectedListener the first time the dates are selected.

0reactions
quentin41500commented, Jul 24, 2018

Working as intended, listener are meant to be called upon user clicks on the calendar as of right now.

Also, setSelectedDate does not page the calendar to selected date (if i’m viewing April, for example, and select a February date via setSelectedDate the calendar stays on April).

use widget.setCurrentDate(instance); with setSelectedDate to page over.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OnRangeSelectedListener and ClickListener both are not ...
I'm using latest version of material calendarview with range mode and when I'm trying to get selected dates, listeners are not working.
Read more >
MaterialCalendarView - GitHub Pages
Allow the user to click on dates from other months that are not out of range. ... Sets the listener to be notified...
Read more >
CalendarView - Android Developers
Sets the listener to be notified upon selected date change. void, setSelectedDateVerticalBar(int resourceId). This method was deprecated in API level 23. No ......
Read more >
Material Calendar View - The Android Arsenal
Material Calendar View. A Material design back port of Android's CalendarView. The goal is to have a Material look and feel, ...
Read more >
Android Custom Calendar with events | by Patel prashant
Material-Calendar-View is a simple and customizable calendar ... date or selected date); we make no guarantee those modifications will be ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found