I have three array
int[] image = {R.drawable.img1,R.drawable.img2} int[] sound= {R.raw.m1,R.raw.m2} String[] nom ={"el1","el2"}
I tryed to change a view with imageview, text from those array when click button but i got only the last value from three array these my method i call when onclick method
private void updateData() {
while (i<nom.length) {
ImageView.setImageResource(image[i]);
textview.setText(nom[i]);
mysong = MediaPlayer.create(Activity.this, sound[i]);
mysong.start();
i++;
}
}
2
Answers
Try this….
Note : Make Sure Your All Three Array Same Size…
Try this….
And After OnClick
Note : Make Sure Your All Three Array Same Size…