fade in animation in android
<p>I have written the code to create slide show that contains the alpha animation effect. I have inserted the image resource in the array and apply the animation for particular image when it id called. 
The Problem is that the animation is not applied for array index 1,3,5(R.drawable.b,R.drawable.d,R.drawable.f). The code is given below.
Activity- Java code---</p>

<pre><code>public class DivyeshAnimationActivity extends Activity implements AnimationListener {

int imagearray[]={R.drawable.a,R.drawable.b,R.drawable.c,R.drawable.d,R.drawable.e,R.drawable.f};


ImageView img,img1;

Animation anim,anim1;
int counter;
int k;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    img=(ImageView)findViewById(R.id.img);
    anim=AnimationUtils.loadAnimation(DivyeshAnimationActivity.this,
            R.anim.anim);
    img.setImageResource(imagearray[counter]);
    img.startAnimation(anim);
    anim.setAnimationListener(this);
    }

public void onAnimationEnd(Animation animation) {
    if(counter==imagearray.length-1)
    {
        counter=0;
    }
    else
    {
        counter++;  
    }
        img.setImageResource(imagearray[counter]);
        img.startAnimation(anim);   
}
public void onAnimationRepeat(Animation animation) {


}
public void onAnimationStart(Animation animation) {

}}
</code></pre>

<p>THe anim file contains the following code..</p>

<pre><code>&lt;alpha 
    android:fromAlpha="0"
    android:toAlpha="1"
    android:duration="2000"/&gt;
</code></pre>
