Private class Textview_persinal_birth_onclick implements View.onclicklistener {
@Override
public void OnClick (View v) {
Datepickerdialog.ondatesetlistener datesetlistener=new Datepickerdialog.ondatesetlistener () {
@Override
public void Ondateset (DatePicker view, int year, int monthofyear, int dayofmonth) {
Calendar.set (calendar.year,year);
Calendar.set (calendar.month,monthofyear);
Calendar.set (Calendar.day_of_month,dayofmonth);
try {
Date Date_input=simpledateformat.parse (Simpledateformat.format (Calendar.gettime ()));
Date Date_system=simpledateformat.parse (Simpledateformat.format (Calendar.getinstance (). GetTime ()));
Long Inputtime=date_input.gettime ();
Long Systemtime=date_system.gettime ();
if (inputtime<=systemtime) {
Birth=simpledateformat.format (Calendar.gettime ());
Textview_persional_birth.settext (birth);
}
Else
Toast.maketext (personalinformationactivity.this, "birthdays cannot be greater than the current date! ", 1). Show ();
} catch (ParseException e) {
E.printstacktrace ();
}
}
};
New Datepickerdialog (Personalinformationactivity.this,
Datesetlistener,
Calendar.get (Calendar.year),
Calendar.get (Calendar.month),
Calendar.get (Calendar.day_of_month)). Show ();
}
}