I want to put a timer on the imageSwitcher
class. I was able to do that for 2 pictures using the following code, but I can't add more pictures. Can anyone tell me how can I add more pictures to the ImageSwitcher
Timer?
imageSwitcher.postDelayed(new Runnable() {
int i = 0;
public void run() {
imageSwitcher.setImageResource(
i++ % 2 == 0 ?
R.drawable.image1 :
R.drawable.mage2);
imageSwitcher.postDelayed(this, 1000);
}
}, 1000);