How to use different variable or array for different Listview items in Android? -
i trying make e-commerce app. when click on add "+" sign, quantity , sub-total calculated on basis of price.please assist me in re-initializing variable each item of listview
. working fine first item.
i resolved this. not satisfied. can improve using list or array???
add.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { string q= (string) quantity.gettext(); double d = double.parsedouble(q); qty=d; qty++; double sub_total =currentitem.getprice(); item_sub_total = qty*sub_total; quantity.settext(string.valueof(qty)); subtotal.settext(string.valueof(item_sub_total)); } });
Comments
Post a Comment