I am trying to keep constraint on date and time. I want that if user tries to set date less than current date then it should show alert, and same thing is to be done with ti
protected boolean checkDateValidity(Date date){
Calendar cal = new GregorianCalendar(date.getYear() + 1900, date.getMonth(), date.getDate(), date.getHours(), date.getMinutes());
if((cal.getTimeInMillis()-System.currentTimeMillis()) <= 0){
return false;
}else{
return true;
}
}
pass the date object to this method
if it returns false means you will show alert message