@Override
 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
   CardPresenter cardPresenter = mCardPresenters.get(position);
   PendingIntent pendingIntent = cardPresenter.getPendingIntent();
   if (pendingIntent != null) {
     try {
       pendingIntent.send();
     } catch (CanceledException e) {
       Log.w(TAG, e.getMessage());
     }
   } else {
     Log.w(TAG, "No PendingIntent attached to card!");
   }
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Intent intent = getIntent();
    if (savedInstanceState != null) {
      readExtras(intent.getExtras());
      Log.i("TAG", "In saved instance state");

    } else if (intent != null && intent.getExtras() != null) {
      readExtras(intent.getExtras());
      Log.i("TAG", "In get extras");

    } else {
      Log.e(TAG, "No extras were present");
      Intent codeIntent = new Intent(this, CaptureActivity.class);
      startActivity(codeIntent);
      finish();
      return;
    }

    if (mCardPresenters.size() == 0) {
      Log.w(TAG, "There were no cards to display");
      Intent codeIntent = new Intent(this, CaptureActivity.class);
      startActivity(codeIntent);
      finish();
      return;
    }
    Intent codeIntent = new Intent(this, StartWorkflowActivity.class);
    codeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    codeIntent.putExtra("barCodeText", firstCard.getFooter());
    startActivity(codeIntent);
    finish();

    /*  mCardScrollView = new CardScrollView(this);
    mCardScrollView.setAdapter(new CardScrollViewAdapter(this, mCardPresenters));
    mCardScrollView.activate();
    mCardScrollView.setOnItemClickListener(mOnItemClickListener);

    setContentView(mCardScrollView);*/
  }
 @Override
 public View getView(int position, View convertView, ViewGroup parent) {
   CardPresenter cardPresenter = mCardPresenters.get(position);
   return cardPresenter.getCardView(mContext);
 }