i am using following example of date picker
http://developer.android.com/guide/tutorials/views/hello-datepicker.html
now i want to perform some functionality
public void showDatePicker() {
final Calendar c = Calendar.getInstance();
int year = c.get(Calendar.YEAR);
int month = c.get(Calendar.MONTH);
int day = c.get(Calendar.DAY_OF_MONTH);
DatePickerDialog datePicker = new DatePickerDialog(getActivity(), (view, year1, month1, day1) -> {
Calendar c1 = Calendar.getInstance();
c1.set(year1, month1, day1);
Date date = c1.getTime();
SimpleDateFormat formatter = new SimpleDateFormat("dd MMMM yyyy");
String d = formatter.format(date);
// btnDatePicker.setText(d);
// selectedDate = d;
}, year, month, day) {
@Override
public void onClick(@NonNull DialogInterface dialog, int which) {
super.onClick(dialog, which);
if (which == DialogInterface.BUTTON_POSITIVE) {
} else if (which == DialogInterface.BUTTON_POSITIVE) {
}
}
};
datePicker.getDatePicker().setMinDate(System.currentTimeMillis());
datePicker.show();
}