Displaying a sequence of images with a time delay
<p>I wanted to display 9 images one after the other. I have included the 9 images as an array:</p>

<pre><code>imageHolders = new ArrayList&lt;ImageView&gt;();
    imageHolders.add((ImageView) view.findViewById(R.id.imgOne));
    imageHolders.add((ImageView) view.findViewById(R.id.imgTwo));
    imageHolders.add((ImageView) view.findViewById(R.id.imgThree));
    imageHolders.add((ImageView) view.findViewById(R.id.imgFour));
    imageHolders.add((ImageView) view.findViewById(R.id.imgFive));
    imageHolders.add((ImageView) view.findViewById(R.id.imgSix));
    imageHolders.add((ImageView) view.findViewById(R.id.imgSeven));
    imageHolders.add((ImageView) view.findViewById(R.id.imgEight));
    imageHolders.add((ImageView) view.findViewById(R.id.imgNine));
</code></pre>

<p>This is what I have tried:</p>

<pre><code>public void handleMessage(Message msg) {
        int currentImage = 0;
        int nextImage = 0;
        // Logic to change the images
        for (final ImageView imageView : imageHolders) {
            currentImage = Integer.parseInt(imageView.getTag().toString());
            if (currentImage &gt; 1) {
                nextImage = currentImage - 1;
            } else {
                nextImage = 9;
            }
                     imageView.setTag(""+nextImage);

            new CountDownTimer(10000, 1000) {

                 public void onTick(long millisUntilFinished) {

                 }

                 public void onFinish() {
                        imageView.setVisibility(VISIBLE);
                 }
              }.start();        

        }
        super.handleMessage(msg);
    }

}
</code></pre>

<p>There is a delay between the first and the second images. I am not able to introduce a delay between the rest. I have no clue about introducing the delay. Any suggestions would be appreciated.</p>
