title: Custom List View; Button click and set text in each row
body: <p>I have a custom List View Adapter. When I click a button in a row, I want to change the text in that same row. However, I am getting an error. When I click on the button in row 0, it changes the text in row 1 or 2 instead (random). Also, do I need to use<code>setTag();</code> and <code>getTag();</code></p>
  
  <p>How can I get the button in row 0 to change the text in row 0 when it is clicked.</p>
  
  <p><strong>Custom List Row Code</strong></p>
  
  <pre><code>public CustomFeedListViewAdapter(Context context, ArrayList&lt;HashMap&lt;String, String&gt;&gt; data) {
      mContext = context;
      feed = data;
      inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
  }
  
  
    @Override
  public View getView(int i, View view, ViewGroup viewGroup) {
       position = i;
  
      View mView = view;
  
  
      if (view == null) {
  
  
          mView = inflater.inflate(R.layout.feed_list_row, viewGroup, false);
  
          feedNumOfLikes = (TextView) mView.findViewById(R.id.feedNumofLikes);
          feedUpVoteButton = (Button) mView.findViewById(R.id.feedUpVoteButton);
          feedDownVoteButton = (Button) mView.findViewById(R.id.feedDownVoteButton);
  
          HashMap&lt;String, String&gt; mFeed = new HashMap&lt;&gt;();
          mFeed = feed.get(i);
  
         // feedUpVoteButton.setTag(i);
        //  feedNumOfLikes.setTag(i);
  
  
          feedUpVoteButton.setOnClickListener(this);
  
      }
      return mView;
  }
  
  
  @Override
  public void onClick(View v) {
  
      switch (v.getId()) {
  
          case R.id.feedUpVoteButton:
  
              //v.getTag();
  
              likes  +=1;
              Log.i("yo", String.valueOf(position));
              feedNumOfLikes.setText(String.valueOf(likes));
              break;
  
          case R.id.feedDownVoteButton:
              // Do stuff when imageView1 is clicked...
  
          default:
              break;
      }
    }
  }
  </code></pre>