public static boolean sameDate(Calendar cal,Date selectedDate){
  Calendar selectedCal=Calendar.getInstance();
  selectedCal.setTime(selectedDate);
  return cal.get(Calendar.MONTH) == selectedCal.get(Calendar.MONTH) && cal.get(Calendar.YEAR) == selectedCal.get(Calendar.YEAR) && cal.get(Calendar.DAY_OF_MONTH) == selectedCal.get(Calendar.DAY_OF_MONTH);
}

public static boolean sameDate ( Calendar cal , Date selectedDate ) { Calendar selectedCal = Calendar . getInstance ( ) ; selectedCal . setTime ( selectedDate ) ; return cal . get ( Calendar . MONTH ) == selectedCal . get ( Calendar . MONTH ) && cal . get ( Calendar . YEAR ) == selectedCal . get ( Calendar . YEAR ) && cal . get ( Calendar . DAY_OF_MONTH ) == selectedCal . get ( Calendar . DAY_OF_MONTH ) ; }
check if a date instance and a calendar instance have the same time ( by month , year and day of month )
