play Animation - Android Animation

Android examples for Animation:Animation Creation

Description

play Animation

Demo Code

/*******************************************************************************
 * Copyright (c) 2012 Vincenzo Marzano.//from   w w w  .  j  a  v a2s .  c  om
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl.html
 * 
 * Contributors:
 *     Vincenzo Marzano - initial API and implementation
 ******************************************************************************/
//package com.java2s;

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);
    }
}

Related Tutorials