Exception: no non-static method "Landroid/app/DatePickerDialog;.

I'm getting an exception when trying to instantiate a DatePickerDialog on a generic tablet running Android 5.1 ( API Level 22 )

Java.Lang.NoSuchMethodError: no non-static method "Landroid/app/DatePickerDialog;.<init>(Landroid/content/Context;)V"

The exception occurs when running the following block of code:

        public void OnClick(View v)
        {
            DatePickerDialog dialog = new DatePickerDialog(_c); // Here
            dialog.SetOnDateSetListener(this);
            dialog.Show();
        }

I checked the API Level for the DatePickerDialog and also, this code runs perfectly on a Galaxy S7 with Android 8.0
Couldn't find anything on Google, so I thought I should post it here

Any guidance on what the problem may be, or how to debug this?

Thanks

Posts

  • LeopoldoJurezLeopoldoJurez USMember

    I used a Xamarin binding of MaterialDateTimePicker and it solved the issue

    But still, don't know why this exception happens in the first place

Sign In or Register to comment.