How to change an image to the next one in the array using a for loop, once a button has been clicked. At present I have this in my on click method.
int[] Pics = {R.drawable.pic1, R.drawable.pic2, R.drawable.pic3};
for (int i=0; i<Pics.length; i++){
mainpic.setImageResource(Pics[i]);
}
The problem is when the next button is clicked, it only stays at the first image or goes straight through to the last image.