title: ListView: 1st Item of the listview affects its last item
body: <p>i have a listview populated by two button and a textview. The problem is that every time I change the value to the last textview of my listview it resets the first, and if I change the first it resets the last. I also tried to use the tags and then compare them, but it doesn't work anyway. I don't understand where the problem is. Could anyone help me?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>public class ProductListAdapterforListView extends BaseAdapter {
      private Context mContext;
      private List&lt;piatto&gt; mProductList;
      private LayoutInflater inflater = null;
      int[] bStatus;
  
      public ProductListAdapterforListView(Context mContext, List&lt;piatto&gt; mProductList) {
          this.mContext = mContext;
          this.mProductList = mProductList;
          inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          bStatus = new int[mProductList.size()];
  
      }
      @Override
      public int getCount() {
          return mProductList.size();
      }
  
      @Override
      public Object getItem(int position) {
          return mProductList.get(position);
      }
  
      @Override
      public long getItemId(int position) {
          return position;
      }
  
  
      @Override
      public View getView(final int position, View convertView, ViewGroup parent) {
          Viewholder viewholder;
          View row=convertView;
          if (row == null){
              viewholder=new Viewholder();
  
              row=inflater.inflate(R.layout.row_data_list, parent, false);
  
  
              viewholder.nome= (TextView) row.findViewById(R.id.namepiatto);
              viewholder.imageView= (ImageView) row.findViewById(R.id.imagepiatto);
              viewholder.prezzo= (TextView) row.findViewById(R.id.prezzopiatto);
              viewholder.btntakemore=(Button) row.findViewById(R.id.takemore);
              viewholder.btntakeless=(Button) row.findViewById(R.id.takeoff);
              viewholder.textViewcount=(TextView) row.findViewById(R.id.count);
  
              viewholder.btntakemore.setTag(position);
              viewholder.btntakeless.setTag(position);
              viewholder.textViewcount.setTag(position);
  
              row.setTag(viewholder);
  
          } else {
              viewholder = (Viewholder) row.getTag();
          }
  
          viewholder.nome.setText(mProductList.get(position).getNome());
          viewholder.prezzo.setText(mProductList.get(position).getPrezzo());
          Picasso.get().load(mProductList.get(position).getImmagine()).into(viewholder.imageView);
  
          viewholder.btntakemore.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  int v= (int) viewholder.btntakemore.getTag();
                  int v1= (int) viewholder.textViewcount.getTag();
  
                  if (v==v1){
                      int val= Integer.parseInt(String.valueOf(viewholder.textViewcount.getText()));
                      if (val &lt; 5){
                          val=val + 1;
                          viewholder.textViewcount.setText(String.valueOf(val));
                          notifyDataSetChanged();
                      }
                  }
  
              }
          });
  
  
          viewholder.btntakeless.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  int v= (int) viewholder.btntakeless.getTag();
                  int v1= (int) viewholder.textViewcount.getTag();
  
                  if (v==v1){
                      int val= Integer.parseInt(String.valueOf(viewholder.textViewcount.getText()));
                      if (val &lt; 5){
                          val=val + 1;
                          viewholder.textViewcount.setText(String.valueOf(val));
                          notifyDataSetChanged();
                      }
                  }
              }
          });
  
          return row;
      }
  
      public class Viewholder {
          TextView nome;
          TextView prezzo;
          ImageView imageView;
          Button btntakemore, btntakeless;
          TextView textViewcount;
      }
  
  }</code></pre>
  </div>
  </div>
  </p>