square / android-times-square

Standalone Android widget for picking a single date from a calendar view.
Apache License 2.0
4.45k stars 1.19k forks source link

NullPointerException when using highlightDates #519

Closed DulayelNotaifi closed 1 year ago

DulayelNotaifi commented 1 year ago

/ ArrayList d = new ArrayList(); Date d1 = new Date(2023,5,29); Date d2 = new Date(2023,5,28); Date d3 = new Date(2023,5,27); d.add(d1); d.add(d2); d.add(d3); datePicker.highlightDates(d); / this code throws a "java.lang.NullPointerException: Attempt to invoke virtual method 'void com.squareup.timessquare.CalendarPickerView.highlightDates(java.util.Collection)' on a null object reference" How can I fix it? also, how can I choose the highlight color?