title: How to print all the values inside for loop in Android?
body: <p>I am getting quite confused why i am not able print the all array values inside the loop. It's only printing the last value of the array. </p>
  
  <p>the following code-:</p>
  
  <pre><code>package com.example.code_1;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.view.Menu;
  import android.widget.TextView;
  import android.util.Log;
  
  
  public class MainActivity extends Activity 
  {
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) 
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      TextView tt=(TextView)findViewById(R.id.and);
  
  
      try
      {
  
  
   String abc[]={"1","2","3","4","5","6","7","8","9","10","11","12"};
  
  
          for(int i=0;i&lt;abc.length;i++)
          {
  
               tt.setText(String.valueOf(abc[i]));
  
          }
  
      }
      catch(NullPointerException e)
      {
  
  
      }
  
   }
  </code></pre>
  
  <p>}</p>
  
  <p>I searched the internet and i found to use <strong>StringBuilder</strong> class to append all values and display the array outside the loop but i think it's quite similar to sum the all content into a string display it in a single variable. I don't want this solution.</p>
  
  <p>Please help me out, how can i print all values inside the loop. !!!</p>
  
  <p>Thanks in Advance..</p>