forum

Home / DeveloperSection / Forums / How to Print Multiple Statements to One TextView

How to Print Multiple Statements to One TextView

Jayden Bell 1846 30-May-2013
Hi Everyone!

I have the following code:

for(int i = 1; i <= doubleLength; i++) {
    doubleRate = (doubleBalance * (doubleRate/100))/12;
    doubleBalance = doubleBalance + doubleRate;
    doublePayment = (doubleBalance/doubleCount);

    TextView results = (TextView) findViewById(R.id.showResult);
    results.setText(doublePayment+"");

    doubleCount = doubleCount - 1;
    doubleBalance -= doublePayment;
}

What I'm trying to do is print out every single value of the "doublePayment" value to a TextView UI Object on the screen. However, when the for loop finishes, it only 

prints out one value, instead of several.

I'm porting this over from C++, so I'm used to simply using count to print to the terminal.

Thanks in advance!


Updated on 30-May-2013

Can you answer this question?


Answer

1 Answers

Liked By