I am trying to get the values I have in an array to a text view, I am using a ViewFlipper and I would like to change the textview at the same time the image changes.
for (int i = 0; i < imagens.length && i < 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);
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?