I have created a program that receives the elements of an arithmetic progression (First term, ratio and number of terms) and returns all the terms of the progression and the sum of those terms. The sum shows it well, but when I want to see all the terms it only shows me the last one.
Here is my code. As I said, everything works fine, the only thing that does not work out is that all the terms of the progression are shown:
public void mostrarProgresion(View view){
asignarDatos();
//n1=Primer Término
//n2=Razón
//n3=Número de Términos
total=n2*n3;
if (n1>=n3){
total+=n1;
}
for (int i=n1;i<total;i=i+n2){
txvres.setText(i);
}
}