Code example for ViewAnimator

Methods: showPrevious

0
        mAnimator = (ViewAnimator) findViewById(R.id.animator);
        populateAnimator(); 
    } 
 
    public void onBack(final View view) {
        mAnimator.showPrevious();
    } 
 
    public void onNext(final View view) {
        mAnimator.showNext();
    } 
 
    private void populateAnimator() { 
        for (int i = 0; i < COLORS.length; i++) {
            final ImageView view = new ImageView(this);
            view.setBackgroundColor(COLORS[i]);
            mAnimator.addView(view);
        } 
    } 
 
}