Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.app.Activity;
import android.content.Context;

import android.view.animation.Animation;
import android.view.animation.AnimationUtils;

public class Main {

    public static void startAnim(Context context, int resId, int resAnimId) {
        //      Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake);
        //      findViewById(R.id.xxx).startAnimation(shake);

        Animation shake = AnimationUtils.loadAnimation(context, resAnimId);
        ((Activity) context).findViewById(resId).startAnimation(shake);
    }

    public static Animation loadAnimation(Context context, int id) {

        Animation myAnimation = AnimationUtils.loadAnimation(context, id);
        return myAnimation;
    }
}