Android: ImageSwitcher
<p>I have a ImageSwitcher and 2 buttons..."Next" and "Previous" to slide images...But its animate my sliding only in one side from left to the right...How to fix that ? thanks...</p>

<pre><code>Integer[] imageIDs = { R.drawable.image_one, R.drawable.image_two,
        R.drawable.image_tree };

private ImageSwitcher imageSwitcher;
private Button nextButton;
private Button previousButton;


@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    final Animation in = AnimationUtils.loadAnimation(this,
            android.R.anim.slide_in_left);
    final Animation out = AnimationUtils.loadAnimation(this,
            android.R.anim.slide_out_right);

    imageSwitcher = (ImageSwitcher) findViewById(R.id.switcher1);
    imageSwitcher.setFactory(this);
    imageSwitcher.setInAnimation(in);
    imageSwitcher.setOutAnimation(out);
    imageSwitcher.setImageResource(imageIDs[0]);

    nextButton = (Button) findViewById(R.id.next);
    nextButton.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            imageSwitcher.setImageResource(imageIDs[1]);

        }
    });

    previousButton = (Button) findViewById(R.id.previous);
    previousButton.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {

            imageSwitcher.setImageResource(imageIDs[0]);
        }
    });

}

public View makeView() {
    ImageView imageView = new ImageView(this);
    imageView.setBackgroundColor(0xFF000000);
    imageView.setScaleType(ImageView.ScaleType.CENTER);
    imageView.setLayoutParams(new ImageSwitcher.LayoutParams(
            LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
    return imageView;
}
</code></pre>
