Program: 187216
Project: 187216
Buggy source:
private void initActivityList(){
  mCardView=(CardUI)findViewById(R.id.cardsview);
  mCardView.clearCards();
  mCardView.setSwipeable(false);
  ArrayList<ActivityEntry> alActivity=new ArrayList<ActivityEntry>();
  for (int i=mLessonsCompleted.size() - 1; i > mLessonsCompleted.size() - 4 && i > -1; i--) {
    Lesson lesson=mLessonsCompleted.get(i);
    MyCard card=new MyCard(getString(R.string.lessons_congratulations_you_have_completed_the_lesson_),lesson.mTitle);
    card.setIcon(R.drawable.ic_home_lesson);
    card.setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        startActivity(new Intent(HomeActivity.this,LessonsActivity.class));
      }
    }
);
    Date cardDate=new Date();
    if (lesson.mStatusModified != null)     cardDate=lesson.mStatusModified;
    ActivityEntry ae=new ActivityEntry(card,cardDate);
    alActivity.add(ae);
  }
  for (int i=mListProjects.size() - 1; i > mListProjects.size() - 4 && i > -1; i--) {
    Project project=mListProjects.get(i);
    Media[] mediaList=project.getScenesAsArray()[0].getMediaAsArray();
    Drawable img=null;
    if (mediaList != null && mediaList.length > 0) {
      for (      Media media : mediaList)       if (media != null) {
        Bitmap bmp=getThumbnail(media);
        if (bmp != null) {
          img=new BitmapDrawable(getResources(),bmp);
          break;
        }
      }
    }
    if (img != null) {
      MyCard card=new MyCard(getString(R.string.title_activity_new_story),project.getTitle());
      card.setImage(img);
      card.setId(i);
      card.setOnClickListener(new OnClickListener(){
        @Override public void onClick(        View v){
          showProject(v.getId());
        }
      }
);
      Date cardDate=new Date(new File(mediaList[0].getPath()).lastModified());
      ActivityEntry ae=new ActivityEntry(card,cardDate);
      alActivity.add(ae);
    }
 else {
      MyCard card=new MyCard(getString(R.string.title_activity_new_story),project.getTitle());
      card.setId(i);
      card.setOnClickListener(new OnClickListener(){
        @Override public void onClick(        View v){
          showProject(v.getId());
        }
      }
);
      mCardView.addCard(card);
      Date cardDate=new Date();
      if (mediaList.length > 0)       cardDate=new Date(new File(mediaList[0].getPath()).lastModified());
      ActivityEntry ae=new ActivityEntry(card,cardDate);
      alActivity.add(ae);
    }
  }
  Collections.sort(alActivity);
  for (  ActivityEntry ae : alActivity)   mCardView.addCard(ae.card);
  mCardView.refresh();
}

Fixed version (ground truth):
private void initActivityList(){
  mCardView=(CardUI)findViewById(R.id.cardsview);
  if (mCardView == null)   return;
  mCardView.clearCards();
  mCardView.setSwipeable(false);
  ArrayList<ActivityEntry> alActivity=new ArrayList<ActivityEntry>();
  for (int i=mLessonsCompleted.size() - 1; i > mLessonsCompleted.size() - 4 && i > -1; i--) {
    Lesson lesson=mLessonsCompleted.get(i);
    MyCard card=new MyCard(getString(R.string.lessons_congratulations_you_have_completed_the_lesson_),lesson.mTitle);
    card.setIcon(R.drawable.ic_home_lesson);
    card.setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        startActivity(new Intent(HomeActivity.this,LessonsActivity.class));
      }
    }
);
    Date cardDate=new Date();
    if (lesson.mStatusModified != null)     cardDate=lesson.mStatusModified;
    ActivityEntry ae=new ActivityEntry(card,cardDate);
    alActivity.add(ae);
  }
  for (int i=mListProjects.size() - 1; i > mListProjects.size() - 4 && i > -1; i--) {
    Project project=mListProjects.get(i);
    Media[] mediaList=project.getScenesAsArray()[0].getMediaAsArray();
    Drawable img=null;
    if (mediaList != null && mediaList.length > 0) {
      for (      Media media : mediaList)       if (media != null) {
        Bitmap bmp=getThumbnail(media);
        if (bmp != null) {
          img=new BitmapDrawable(getResources(),bmp);
          break;
        }
      }
    }
    if (img != null) {
      MyCard card=new MyCard(getString(R.string.title_activity_new_story),project.getTitle());
      card.setImage(img);
      card.setId(i);
      card.setOnClickListener(new OnClickListener(){
        @Override public void onClick(        View v){
          showProject(v.getId());
        }
      }
);
      Date cardDate=new Date(new File(mediaList[0].getPath()).lastModified());
      ActivityEntry ae=new ActivityEntry(card,cardDate);
      alActivity.add(ae);
    }
 else {
      MyCard card=new MyCard(getString(R.string.title_activity_new_story),project.getTitle());
      card.setId(i);
      card.setOnClickListener(new OnClickListener(){
        @Override public void onClick(        View v){
          showProject(v.getId());
        }
      }
);
      mCardView.addCard(card);
      Date cardDate=new Date();
      if (mediaList.length > 0)       cardDate=new Date(new File(mediaList[0].getPath()).lastModified());
      ActivityEntry ae=new ActivityEntry(card,cardDate);
      alActivity.add(ae);
    }
  }
  Collections.sort(alActivity);
  for (  ActivityEntry ae : alActivity)   mCardView.addCard(ae.card);
  mCardView.refresh();
}