title: Android ListView Adapter OnClick selects wrong Position
body: <p>I went through all the answers and questions on StackOverflow regarding this but I can't seem to edit my code to rectify the issue.</p>
  
  <p>Basically, I have a button that needs an OnClick listener set inside the ListView Adapter. Each row has a unique ID and the wrong id gets selected when I click on the button, which basically means its selecting the wrong position.</p>
  
  <p>Here's my Adapter code:</p>
  
  <pre><code>public class FeedAdapter extends BaseAdapter {
  
      ArrayList&lt;ActivityObject&gt; actList = new ArrayList&lt;ActivityObject&gt;();
      String currActID;
  
      //More code
  
       public View getView(int position, View convertView, ViewGroup parent) {
  
          Holder holder;
          final ActivityObject act = actList.get(position);
          currActID = act.getId();
  
          if (convertView == null) {
               convertView = inflater.inflate(R.layout.feed_single_picture, parent, false);
               holder = new Holder();
               holder.comment = (ImageButton) convertView.findViewById(R.id.commentbutton);
               convertView.setTag(holder);
         } else {
               holder = (Holder) convertView.getTag();
         }
  
         holder.comment.setOnClickListener(new View.OnClickListener() {
               @Override
               public void onClick(View v) {
                  //Log.d("Check",currActID);
                  //Selects the Wrong ID
                  Intent myIntent = new Intent(activity, CommentActivity.class);
                  v.getContext().startActivity(myIntent);
               }
         });
  
         return convertView;
      }
  </code></pre>
  
  <p>What am I doing wrong guys? Can you point out the mistake please.</p>