I use a DatePicker
widget in Android for the user to set a date, and want to get the date value when a confirm button is clicked, how can I do that?
Try this:
DatePicker datePicker = (DatePicker) findViewById(R.id.datePicker1);
int day = datePicker.getDayOfMonth();
int month = datePicker.getMonth() + 1;
int year = datePicker.getYear();