how to fade in 1 image fade out 2nd image?
<p>i found this tutorial <a href="http://android-er.blogspot.com/2012/02/animate-fade-infade-out-by-changing.html" rel="nofollow">http://android-er.blogspot.com/2012/02/animate-fade-infade-out-by-changing.html</a>   which fade in fade out same image how do change this code to use two images fade in 1 image fade out 2nd automatically???</p>

<pre><code>import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageView;

 public class AndroidAnimTranslateActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);


    Button buttonFadeOut = (Button)findViewById(R.id.fadeout);
    final ImageView image = (ImageView)findViewById(R.id.image);

     Animation animationFadeIn = AnimationUtils.loadAnimation(this, R.anim.fadein);

    image.startAnimation(animationFadeIn);
    animationFadeIn.setAnimationListener(new AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
            // TODO Auto-generated method stub

        }

        @Override
        public void onAnimationRepeat(Animation animation) {
            // TODO Auto-generated method stub

        }

        @Override
        public void onAnimationEnd(Animation animation) {
            // TODO Auto-generated method stub

            image.startAnimation(animationFadeOut);

        }
    });
    final Animation animationFadeOut = AnimationUtils.loadAnimation(this,  
 R.anim.fadeout);
    buttonFadeOut.setOnClickListener(new Button.OnClickListener(){

        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            image.startAnimation(animationFadeOut);
        }});
 }
}


        &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
       android:layout_width="fill_parent"
   android:layout_height="fill_parent"
  android:orientation="vertical" &gt;

 &lt;TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
     android:text="@string/hello" /&gt;
 &lt;Button
    android:id="@+id/fadein"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Fade In"/&gt;
 &lt;Button
    android:id="@+id/fadeout"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Fade Out"/&gt;
&lt;LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" 
    android:gravity="center"&gt;

    &lt;ImageView
        android:id="@+id/image"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:src="@drawable/ic_launcher" /&gt;

&lt;/LinearLayout&gt;    

     &lt;/LinearLayout&gt;



         &lt;!-------fadein.xml--&gt;&gt;


        &lt;?xml version="1.0" encoding="utf-8"?&gt;
 &lt;set xmlns:android="http://schemas.android.com/apk/res/android"
 android:interpolator="@android:anim/linear_interpolator"&gt;
 &lt;alpha 
    android:fromAlpha="0.1" 
    android:toAlpha="1.0" 
    android:duration="2000" 
    /&gt;
     &lt;/set&gt;



 &lt;!--------fadeout.xml-----&gt;


               &lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator"&gt;
&lt;alpha 
    android:fromAlpha="1.0" 
    android:toAlpha="0.1" 
    android:duration="2000" 
    /&gt;
&lt;/set&gt;
</code></pre>
