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.

[DatePicker] Null pointer exception in mobile date picker

See original GitHub issue

Description:

  1. Launch Material Date Picker in Catalog (Pickers -> Demo -> Launch Material Date Picker)
  2. Select any day in the view so that it’s highlighted
  3. Press the edit icon to switch to the TextInput field.
  4. The TextInput field should be populated with the selected date.
  5. Press the backspace key to erase the text.
  6. The app will immediately crash after erasing the last character from the field.

Expected behavior: Erasing the last character in the TextInput field should be erased.

Source code:

    java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference
        at com.google.android.material.datepicker.SingleDateSelector$1.onValidDate(SingleDateSelector.java:113)
        at com.google.android.material.datepicker.DateFormatTextWatcher.onTextChanged(DateFormatTextWatcher.java:64)

Android API version: compileSdkVersion = 29 minSdkVersion = 14 targetSdkVersion = 27

Material Library version: 1.1.0-alpha10

Device: Samsung S8 and Pixel 3 XL

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

0reactions
mcastagnolocommented, Oct 5, 2019

@ldjcmu Should have specified, is it planned for this week EOD today Friday or is it being released before the end of Sunday?

Read more comments on GitHub >

github_iconTop Results From Across the Web

DatePicker crashing with NullPointerException - Stack Overflow
It seems as though you have not initialized edit_eventFrom anywhere in the code you posted. You will need to inflate that View from...
Read more >
DatePickerDialog - Android Developers
Creates a new date picker dialog for the current date using the parent context's default date picker ... Returns the DatePicker contained in...
Read more >
DatePicker - .NET MAUI - Microsoft Learn
The .NET Multi-platform App UI (.NET MAUI) DatePicker invokes the platform's date-picker control and allows you to select a date.
Read more >
NullReferenceException in DateTimePickerAdv.Value
When I try to set the Value of a date time picker, I get a null pointer exception. The code couldn''t be any...
Read more >
Datepicker - Angular Material
This error is thrown if more than one <input> tries to claim ownership over the same <mat-datepicker> (via the matDatepicker attribute on the...
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