title: How can Increase/Decrease Particular Item quantity in Cart Functionality inside RecyclerView?
body: <p>I am working on a cart items based project. In which I have to  Increase/Decrease  Order item Quantity Two Button. Every Thing is Fine But on Particular Item Increase/Decrease Value it can't count from 1 .it can get Previous count Value. </p>
  
  <p><strong>Screenshot</strong></p>
  
  <p><img src="https://i.stack.imgur.com/7jIjJ.png" width="200"></p>
  
  <p>Here is My <code>RecyclerAdapter</code> Code. </p>
  
  <pre><code>public class CheckOutAdapter extends RecyclerView.Adapter&lt;CheckOutAdapter.MyVHolder&gt; {
  
      ArrayList&lt;CartModel&gt; itemsList;
      Context context;
      OnItemClickListner mListner;
      int quantity;
  
  
      public CheckOutAdapter(ArrayList&lt;CartModel&gt; itemsList, Context context) {
          this.context = context;
          this.itemsList = itemsList;
      }
  
      @NonNull
      @Override
      public MyVHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
  
          View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.inflator_for_checkoutfrag, parent, false);
          return new MyVHolder(itemView);
      }
  
      @Override
      public void onBindViewHolder(@NonNull final MyVHolder holder, int position) {
          /*holder.catgry_txt_title.setText(itemsList.get(position).title);
          holder.catgry_img.setImageResource(itemsList.get(position).img);*/
          holder.itemName.setText(itemsList.get(position).CartIteMname);
          holder.itemPartNo.setText(itemsList.get(position).cartItemno);
          holder.finalprice.setText(String.format("%s $", itemsList.get(position).totalprice));
  
          Picasso.with(context).load(itemsList.get(position).carPart_imgURL).into(holder.itemIMG);
  
          quantity = Integer.parseInt(itemsList.get(position).cartQuantity);
  
          if (quantity == 1) {
              holder.txtQuantity.setText(String.valueOf(quantity));
          }
          holder.btnIncrease.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  //int count= Integer.parseInt(String.valueOf(holder.txtQuantity.getText()));
                  quantity++;
                  holder.txtQuantity.setText(String.valueOf(quantity));
  
              }
          });
  
          holder.btnDecrease.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  int count= Integer.parseInt(String.valueOf(holder.txtQuantity.getText()));
  
                  if (quantity&gt;1)
  
                  quantity--;
                  holder.txtQuantity.setText(String.valueOf(quantity));
  
              }
          });
  
      }
  
      @Override
      public int getItemCount() {
          Log.e("adapterLSize",String.valueOf(itemsList.size()));
          return itemsList.size();
      }
  
      class MyVHolder extends RecyclerView.ViewHolder {
          ImageView itemIMG, removeCart, btnIncrease, btnDecrease;
          TextView cartItemTitle, itemName, itemPartNo, finalprice, txtQuantity;
          LinearLayout addtoCart;
          MyVHolder(View itemView) {
              super(itemView);
              cartItemTitle = itemView.findViewById(R.id.cartItemTitle);
              itemName = itemView.findViewById(R.id.itemName);
              itemPartNo = itemView.findViewById(R.id.itemPartNo);
              finalprice = itemView.findViewById(R.id.finalprice);
              itemIMG = itemView.findViewById(R.id.itemIMG);
              txtQuantity = itemView.findViewById(R.id.txtQuantity);
              btnIncrease = itemView.findViewById(R.id.btnIncrease);
              btnDecrease = itemView.findViewById(R.id.btnDecrease);
              removeCart = itemView.findViewById(R.id.removeCart);
          }
  
      }
  
  }
  </code></pre>
  
  <p><strong>My Question:</strong></p>
  
  <ul>
  <li>How can Increase/Decrease Particular Item quantity in Cart Functionality inside RecyclerView in android?</li>
  </ul>