title: update a text view to display from array every second
body: <p>I am trying to build a short memory game and I want a list of words to be shown.</p>
  
  <p>At the start of the activity, the first word, then every second the next word and after the last word is shown the activity changes without user proc. I have tried some things but the closest I've been is just the last word being shown.  Any thoughts?</p>
  
  <p>Java file: </p>
  
  <pre><code> package com.example.pc.myapplication;
  
   import android.app.Activity;
   import android.content.Intent;
   import android.os.Bundle;
   import android.view.View;
   import android.widget.TextView;
  
   import java.util.Random;
  
  
   public class Game1Round1 extends Activity {
  
  
      String[] round1;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.game1round1);
  
          round1 =   getResources().getStringArray(R.array.round1);
  
          Thread t = new Thread() {
  
              @Override
              public void run() {
                  try {
                      while (!isInterrupted()) {
                          Thread.sleep(1000);
                          runOnUiThread(new Runnable() {
                              @Override
                              public void run() {
                                  updateTextView();
                              }
                          });
                      }
                  } catch (InterruptedException e) {
                  }
              }
          };
  
          t.start();
  
  
      Proceed();
      }
  
  
      private void updateTextView() {
          int i= 0;
          while ( i &lt;13) {
              TextView textView = (TextView) findViewById(R.id.randomTextView);
  
  
  
              textView.setText(round1[i]);
             i = i + 1;
          }
      }
  public void Proceed() {
      Intent intent1 = new Intent(this, Game1Start.class);
      startActivity(intent1);
  }
  }
  </code></pre>
  
  <p>And my strings.xml:</p>
  
  <pre><code>   &lt;resources&gt;
  &lt;string name="app_name"&gt;My Application&lt;/string&gt;
  &lt;string-array name="round1"&gt;
      &lt;item&gt;Cinnamon&lt;/item&gt;
      &lt;item&gt;Apple&lt;/item&gt;
      &lt;item&gt;Milk&lt;/item&gt;
      &lt;item&gt;Detergent&lt;/item&gt;
      &lt;item&gt;Cheese&lt;/item&gt;
      &lt;item&gt;Shampoo&lt;/item&gt;
      &lt;item&gt;Butter&lt;/item&gt;
      &lt;item&gt;Tangerine&lt;/item&gt;
      &lt;item&gt;Coffee&lt;/item&gt;
      &lt;item&gt;Marmalade&lt;/item&gt;
      &lt;item&gt;Cabbage&lt;/item&gt;
      &lt;item&gt;Meat&lt;/item&gt;
      &lt;item&gt;Sugar&lt;/item&gt;
  &lt;/string-array&gt;
  </code></pre>
  
  <p></p>