title: Going crazy; how to setOnclickListener from within adapter?
body: <p>So I used to have setOnItemClickListener in my main activity like this:</p>
  
  <pre><code>overviewEventListPending.setOnItemClickListener(new AdapterView.OnItemClickListener() {
      public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id){
          final OverviewEvent clickedOverviewEvent  = (OverviewEvent) parent.getItemAtPosition(position);
          Intent intent = new Intent(OverviewActivity.this, OverviewEventDetails.class);
          intent.putExtra("overViewEventId", clickedOverviewEvent.uuid.toString());
          startActivity(intent);
      }
  });
  </code></pre>
  
  <p>This worked all fine, until my collegue started using BaseAdapter instead of ArrayAdapter as a base class. So I now want to implement the listener within the adapter like this:</p>
  
  <pre><code>public View getView(int position, View convertView, ViewGroup parent) { 
      ViewHolder holder = new ViewHolder();
      int type = getItemViewType(position);
  
      switch (type) {
         case TYPE_ITEM:
              OverviewEvent rowItem = (OverviewEvent) getItem(position);
              convertView = inflater.inflate(R.layout.overview_event, null);
  
              holder.description = (TextView) convertView.findViewById(R.id.overview_event_description);
              holder.amount = (TextView) convertView.findViewById(R.id.overview_event_amount);
              holder.actionDate = (TextView) convertView.findViewById(R.id.overview_event_date);
              holder.counterparty = (TextView) convertView.findViewById(R.id.overview_event_counterparty);
              holder.image = (ImageView) convertView.findViewById(R.id.overview_event_avatar);
  
              holder.description.setText(rowItem.eventDescription);
              holder.amount.setText(rowItem.getDisplayAmount());
              holder.amount.setTextColor(rowItem.getAmountColor());
              holder.actionDate.setText(rowItem.getDisplayDate());
              holder.counterparty.setText(rowItem.creditorDisplayName);
              ImageAdapter image = new ImageAdapter(context);
  
              try {
                  holder.image.setImageBitmap(image.getImage(rowItem.avatarId).getBitmap());
              } catch (Exception e) {
                  throw new RuntimeException("Failed to set overviewEvent avatar", e);
             }
             convertView.setOnClickListener(new View.OnClickListener() {
                  public void onClick(View v) {
                  Intent intent = new Intent(this, OverviewEventDetails.class);
                  intent.putExtra("overViewEventId", uuid.toString());
                  startActivity(intent);
                  }
              });
  
              break;
          case TYPE_DIVIDER:
              OverviewEventDivider divider = (OverviewEventDivider) getItem(position);
              convertView = inflater.inflate(R.layout.overview_event_divider, null);
              TextView dividerTitle = (TextView) convertView.findViewById(R.id.overview_event_divider);
              dividerTitle.setText(divider.title);
              break;
      }
  
      return convertView;
  }
  </code></pre>
  
  <p>It now complains that <code>The constructor Intent(new View.OnClickListener(){}, Class&lt;OverviewEventDetails&gt;) is undefined</code>.</p>
  
  <p>Does anybody know how I can solve this? All tips are welcome!</p>