I want to get total of amount in a textview as shown below.
// List of Amount
for(t=0;t<pname.length;t++) {
newRow = (TableRow) new TableRow(this);
float val1= Float.parseFloat(price);
float val2= Float.parseFloat(rate);
String resultamount = Float.toString(val2- val1);
Double value1 = Double.parseDouble(resultamount);
ilist[a]=(TextView) new TextView(this);
ilist[a].setText(String.format("%.2f", value1));
}
I have created another tablerow outside of for loop to get the total value.
I am now confused how to get the total from the list.
I tried but I am getting the last value of the list as total.