start View Animation - Android User Interface

Android examples for User Interface:View Animation

Description

start View Animation

Demo Code


//package com.java2s;

import android.graphics.drawable.AnimationDrawable;
import android.view.View;
import android.view.animation.Animation;

public class Main {
    private Animation animation;

    public void startAnimation(View view) {
        view.startAnimation(animation);/* w w  w  .  j  a va2s.c  o  m*/
    }

    public static void startAnimation(int resId, View view) {
        view.setBackgroundResource(resId);
        ((AnimationDrawable) view.getBackground()).start();
    }
}

Related Tutorials