My idea is to use an AlertDialog and set to it a a DatePicker.
My code is:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
DatePicker picker = new DatePicker(this);
picker.setCalendarViewShown(false);
builder.setTitle("Create Year");
builder.setView(picker);
builder.setNegativeButton("Cancel", null);
builder.setPositiveButton("Set", null);
builder.show();
it works, but my question is: how can i have the listeners on the set and cancel button?
About the set button i would like to have the listener and (of course) get the date of the user (his date selection)
I want also show just the year so i want to hide the day and month data.