play Animation by animation Id - Android android.view.animation

Android examples for android.view.animation:Animation

Description

play Animation by animation Id

Demo Code

import android.content.Context;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;

public class Main {

  public static void playAnimation(Context context, int animationId, View v) {
    Animation a = AnimationUtils.loadAnimation(context, animationId);
    v.startAnimation(a);/*from   ww  w .  jav a  2  s .c  o m*/
  }

}

Related Tutorials