How to create a DatePickerDialog pre lollipop

0

I've done everything and I could not make a DatePickerDialog like this ...

forprelollipopversions.ThecodeI'musingfornow:

DatePickerDialogdlg=newDatePickerDialog(ActivityAddAvaliacoes.this,newDatePickerDialog.OnDateSetListener(){@OverridepublicvoidonDateSet(DatePickerview,intyear,intmonthOfYear,intdayOfMonth){edtAddData.setText(dayOfMonth+"-"+monthOfYear+"-"+year);
                        }
                    }, year, month,day).show();
    
asked by anonymous 16.11.2015 / 05:15

1 answer

1

As I myself answered this question: Link . This DatePicker is only for Android 5.0 and above, if you want to use it in older versions, you would have to do the upload manually, but fortunately some people have already done it and you can use a ready library:

This: MaterialDateTimePicker allows you to use this DatePicker in versions 4.0 and higher, which would already reach a large share of Android phones .

Secondoption:

But,ifyou'dlikesomethingwithahigherbackwardcompatibility,youcanusethis: android-betterpickers which allows you to use this DatePicker since the API +9 which is Android 2.3:

    
16.11.2015 / 13:13