Android DatePicker Date Limiting -


i using datepicket in activity ,

i want limit date picked user todays date.

they should not able select date greater todays date.

thank you.

yes can easely validation here exemple:

if(dateobj1.before(dateobj2) || dateobj1.equals(dateobj2)){ //the program runs } else{                 new alertdialog.builder(pm_edit.this)                  .settitle("wrong data input!")                  .setmessage("the end date must before start date, please insert new date values")                  .setneutralbutton("ok",                  new dialoginterface.onclicklistener() {                  public void onclick(dialoginterface dialog,                  int which) {                  }                  }).show();             } 

credits to: http://www.brighthub.com/mobile/google-android/articles/41545.aspx


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -