Vote count:
0
My layout is like this : The two buttons on both sides of the edittext is supposed to manipulate the value inside the edittext.
Here is my code for add:
if(etxtQty.getText().toString().length() == 0) {
Log.d("++++", etxtQty.getText().toString());
qty = 1;
etxtQty.setText(1+"");
} else {
etxtQty.setText(qty++ + "");
}
Here is my code for subtract:
if(etxtQty.getText().toString().length() != 0){
qty= Integer.parseInt(etxtQty.getText().toString());
if (Integer.parseInt(etxtQty.getText().toString())> 0){
etxtQty.setText(qty++ +"");
}
} else {
qty = 1;
etxtQty.setText(qty+"");
}
What happens is: the value supposedly for the edittext in the same listview row appears on a different row. Like for example, I have pressed add 2x on a certain row and the value of that edittext in that current row doesn't change. The added value shows up in different rows.
Please help
asked 24 secs ago
How do I get Listview ID and manipulate edittext inside my custom listview
Aucun commentaire:
Enregistrer un commentaire