public void afficherJours(List<Date> dates, int couleur) {

    this.datesAColorier.addAll(dates);
    this.couleurJours = couleur;

    try {
      if (adapter != null) adapter.notifyDataSetChanged();
    } catch (Exception e) {

    }
  }
  public void highlightDates(Collection<Date> dates) {
    for (Date date : dates) {
      validateDate(date);

      MonthCellWithMonthIndex monthCellWithMonthIndex = getMonthCellWithIndexByDate(date);
      if (monthCellWithMonthIndex != null) {
        Calendar newlyHighlightedCal = Calendar.getInstance();
        newlyHighlightedCal.setTime(date);
        MonthCellDescriptor cell = monthCellWithMonthIndex.cell;

        highlightedCells.add(cell);
        highlightedCals.add(newlyHighlightedCal);
        cell.setHighlighted(true);
      }
    }

    adapter.notifyDataSetChanged();
    setAdapter(adapter);
  }
 private void validateAndUpdate() {
   if (getAdapter() == null) {
     setAdapter(adapter);
   }
   adapter.notifyDataSetChanged();
 }