title: How to set text in textview from array
body: <p>I am trying to get the values I have in an array to a text view, I am using a <a href="https://developer.android.com/reference/android/widget/ViewFlipper.html" rel="nofollow noreferrer">ViewFlipper</a> and I would like to change the textview at the same time the image changes. </p>
  
  <pre><code>for (int i = 0; i &lt; imagens.length &amp;&amp; i &lt; categories.length; i++) {
      ImageView imageView = new ImageView(this);
      imageView.setImageResource(imagens[i]);
      simpleViewFlipper.addView(imageView);
  
      info_text3.setText(Arrays.toString(categories));
  }
  
  Animation in = AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left);
  Animation out = AnimationUtils.loadAnimation(this, android.R.anim.slide_out_right);
  simpleViewFlipper.setInAnimation(in);
  simpleViewFlipper.setOutAnimation(out);
  simpleViewFlipper.setFlipInterval(5000);
  simpleViewFlipper.setAutoStart(true);
  </code></pre>
  
  <p>The image part is working and setting the text to the textview is also working, the problem is that the textview is static and that the text in the text view is the entire array and I just want one value, I was thinking linking the array with the 'i' from the for sentence, how can I do this?</p>