public static boolean isYesterday(Date date){
  Calendar calendar=Calendar.getInstance();
  calendar.add(Calendar.DAY_OF_MONTH,-1);
  int nowYear=calendar.get(Calendar.YEAR);
  int nowMonth=calendar.get(Calendar.MONTH);
  int nowMonthDay=calendar.get(Calendar.DAY_OF_MONTH);
  calendar.setTimeInMillis(date.getTime());
  int thenYear=calendar.get(Calendar.YEAR);
  int thenMonth=calendar.get(Calendar.MONTH);
  int thenMonthDay=calendar.get(Calendar.DAY_OF_MONTH);
  return (thenYear == nowYear) && (thenMonth == nowMonth) && (thenMonthDay == nowMonthDay);
}

public static boolean isYesterday ( Date date ) { Calendar calendar = Calendar . getInstance ( ) ; calendar . add ( Calendar . DAY_OF_MONTH , - 1 ) ; int nowYear = calendar . get ( Calendar . YEAR ) ; int nowMonth = calendar . get ( Calendar . MONTH ) ; int nowMonthDay = calendar . get ( Calendar . DAY_OF_MONTH ) ; calendar . setTimeInMillis ( date . getTime ( ) ) ; int thenYear = calendar . get ( Calendar . YEAR ) ; int thenMonth = calendar . get ( Calendar . MONTH ) ; int thenMonthDay = calendar . get ( Calendar . DAY_OF_MONTH ) ; return ( thenYear == nowYear ) && ( thenMonth == nowMonth ) && ( thenMonthDay == nowMonthDay ) ; }
is the specific date yesterday
