new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
int year=mDatePicker.getYear();
int month=mDatePicker.getMonth();
int day=mDatePicker.getDayOfMonth();
//Date date=new GregorianCalendar(year,month,day).getTime();
Calendar calendar=new GregorianCalendar();
int hour=calendar.get(Calendar.HOUR_OF_DAY);
int minute=calendar.get(Calendar.MINUTE);
int second=calendar.get(Calendar.SECOND);
calendar.set(year,month,day,hour,minute,second);
Date date=calendar.getTime();
sendResult(Activity.RESULT_OK,date);
}
})
.create();