I want to increase and decrease the count of each row. I did this but the problem is count value same for each row.so I want when user increase and decrease the count of row 0 the count 1 after that when user come to second-row count should start from 0 not be count 1 Please help me to resolve this issues??.I want to increase and decrease the count of each row. so According to count ,prize should be increased Row 1 Count 1,prize 100 =100 Row 2 Count 2,prize 200= 400 But In my case count always showing last count value.for each row count value should be start from 1
Asked
Active
Viewed 141 times
-2
-
1so far what you tried? – Farhana Naaz Ansari Jun 09 '18 at 12:26
-
Please, post the source code for better understanding the problem. Many thanks – jantursky Jun 09 '18 at 12:26
1 Answers
0
I don't know what you tried so far, but you can do something like this.
holder.ivMinus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int quantity = Integer.parseInt(holder.tvItemQuantity.getText().toString());
if (quantity > 0) {
quantity = quantity - 1;
storeItem.setItemQuantity("" + quantity);
holder.tvItemQuantity.setText(storeItem.getItemQuantity());
totoal = totoal * quantity;
Gtotoal = Gtotoal - Integer.parseInt(storeItem.getItemPrice());
;
settotal.setTotal(" \u20B9 " + Gtotoal);
} else {
}
}
});
holder.ivPlus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int quantity = Integer.parseInt(holder.tvItemQuantity.getText().toString());
quantity = quantity + 1;
storeItem.setItemQuantity("" + quantity);
holder.tvItemQuantity.setText(storeItem.getItemQuantity());
Gtotoal = Gtotoal + Integer.parseInt(storeItem.getItemPrice());
settotal.setTotal(" \u20B9 "+ Gtotoal);
}
});

Farhana Naaz Ansari
- 7,524
- 26
- 65
- 105
-
Thanks for your valuable answer. I want to increase and decrease the count of each row. – Sumit Kumawat Jun 10 '18 at 06:03
-