florent37 / SingleDateAndTimePicker

You can now select a date and a time with only one widget !
Apache License 2.0
1.02k stars 333 forks source link

setTodayText crashes app #235

Open mice777 opened 4 years ago

mice777 commented 4 years ago

No matter where I put call to setTodayText, app crashes:

    java.lang.NullPointerException: Attempt to invoke virtual method 'long java.util.Date.getTime()' on a null object reference
        at java.util.Calendar.setTime(Calendar.java:1749)
        at com.github.florent37.singledateandtimepicker.SingleDateAndTimePicker.getDate(SingleDateAndTimePicker.java:428)
        at com.github.florent37.singledateandtimepicker.SingleDateAndTimePicker.updateDaysOfMonth(SingleDateAndTimePicker.java:499)
        at com.github.florent37.singledateandtimepicker.SingleDateAndTimePicker.setDefaultDate(SingleDateAndTimePicker.java:466)
        at com.github.florent37.singledateandtimepicker.SingleDateAndTimePicker.onAttachedToWindow(SingleDateAndTimePicker.java:221)
        at android.view.View.dispatchAttachedToWindow(View.java:18571)

All I want is change english "Today" to localized version. This seems like impossible.

AgungLaksana commented 4 years ago

same problem here, after setTodayText, then when I scroll the widget to today or before, then it will crash